5 ms·
I think it is hard to learn... using the tools people used to learn DNS with. BIND is great at what it does, but its configuration files suck and its manual is
by jeroenhd 3y ago
I think it is hard to learn... using the tools people used to learn DNS with.
BIND is great at what it does, but its configuration files suck and its manual is long, terse, and unnecessarily complex sometimes. Dig is powerful, but abbreviates everything like we're on an 80 column terminal. At times Wireshark was a better tool debugging DNS issues than Dig was.
Give someone PowerDNS or another modern DNS server and I think they'll have a much better time configuring a working DNS server. I don't know a good modern DNS client, so I've learned to deal with Dig instead. As a user of the "--color" flag for the `ip` command, I'd love to see tools like dig produce more modern output (I'll alias the command line flags, just add it to the command!)
Seriously, "MSG SIZE rcvd: 71" did not need abbreviation. "flags: qr rd ra" could've been full words as well. I don't know what the semicolons before the lines are supposed to convey but they're only making things confusing.
I find it no wonder people get confused learning DNS with the materials provided to them.
- knome 3y ago>I don't know what the semicolons before the lines are supposed to convey but they're only making things confusing all of the lines that aren't part of the query answer are prefixed with semicolons. so it's basically a comment character. presumably to ease processing of the data it spits out. You know. So you can `dig google.com | grep -v '^;' | grep . | awk '{ print $5 }'` easily. I can imagine people using it in a shell script 20 years and more ago to grab a list of IPs to do some domain's health check or whatever Not that you would want to in any modern stack. obviously you'd just use dig's `+short` option :)
- jeroenhd 3y agoNow I just wonder what the double semicolons mean and why they're different from single semicolons :) It's fine, I can Google the answer, I just wished I didn't need to. I already know to use +short when I just want the result(s). I use it in a script to detect and resolve my Pihole's random freezes (by timing the lookup and rebooting the VM every time a lookup fails or takes longer than 200ms, janky but it works).
- dclowd9901 3y agoPerhaps there is info that would normally be present and isn’t, hence stacked semicolons.
- skrebbel 3y agoA precision engineering tool shouldn’t make its users guess like that.
- dclowd9901 3y agoTotally agree.
- deleted 3y ago[deleted]
- tux1968 3y ago> dig google.com | grep -v '^;' | grep . | awk '{ print $5 }'` It wasn't really your point, but hopefully you'll forgive me sharing an equivalent one-liner, without grep: dig google.com | awk '/./ && !/^;/ {print $5}'
- redundantly 3y agoI believe both you and the parent meant to escape the dot, as to only return lines with a dot in them: dig example.com | awk '/\./ && !/^;/ {print $5}' If it isn't escaped it'll just match on everything. If matching everything was intended then you don't need it at all: dig example.com | awk '!/^;/ {print $5}' Will strip out the lines beginning with a semi-colon. However, parsing the output of `dig` this way is not needed. It can be ran to only return the answer, for example: dig +noall +answer example.com Or if you just want the IP for that record: dig +short example.com
- knome 3y agoI was actually just using `grep .` to discard empty lines. The `grep -v '^;'` would have only left lines with answers after it discarded lines starting with `;`. That and the empty lines. I could have combined `grep -v '^;'` and `grep .` as a nice simple `grep '^[^;]'`
- redundantly 3y agoAhh. I was working from memory, I forgot about the empty lines it returns. That's what I get for replying from my phone. :) However, it's still better to just have the `dig` command return only the necessary information via the +short or +noall +answer flags, rather than parsing the full output.
- pests 3y agoRemind me again where this weird syntax came from for passing arguments?
- 3y ago
- chefandy 3y agoI'd conservatively estimate 90% of the people who make core FOSS software interface decisions haven't had to learn anything technical in an entirely unfamiliar domain where there existing mental models didn't apply in decades. Beyond that, many consider having learned these arbitrary, terse interfaces as a badge of honor, and for some reason thinks that makes them better technologists. I'll bet they'd be even better had they been able to focus on the core concepts rather than trying to get into some systems engineer's head who worked at Berkley in 1984.
- TheNewsIsHere 3y agoI think of this in the same way I think of documentation. I try to write documentation that is as clear as it is concise and well structured. But sometimes that’s just not realistically possible, and expressing information often _has_ to assume some level of familiarity with the underlying concepts. I’ve never considered DNS to be a complicated technology, and I’ve never considered that tools like dig and the abbreviations they use need to change much. If there’s something that isn’t clear, it’ll be in the man page, a mailing list, Internet based documentation, StackOverflow, etc. Personally, I value information density, and I don’t mind terseness at all. That doesn’t necessarily mean I would design some of this stuff the same way, but after more than a decade using it, I feel like changing it now is just an appeal to futility. A tool like dig more or less looks and works the same today as it did 15 years ago, and there’s value in that kind of stability.
- chefandy 3y ago> but after more than a decade using it, I feel like changing it now is just an appeal to futility And that's why your learning to use these tools a decade ago was as painful as it was for me 20+ years ago, and so on. Nobody improves it because the only people with the clout to make the changes is too set in their ways to change it, and have come to believe the ridiculous notion that it's beneficial for people to learn it, despite not being related to the actual problem. I worked in technical roles for the better part of 25 years, including 10 as a back end developer. One of the reasons I got into design was to try and break chains like this, but talking to the FOSS community about design gets nearly zero traction and a whole lot of pushback from folks who think they know a lot more about design than they do. Nothing you do matches the information density of a train schedule in a large city, and those designs are so ubiquitous and intuitive that we take them for granted. That was not always the case— someone decided to lay things out like that at some point because they knew it works be easier and more intuitive for the majority even if it might take some adjustment for existing everyday users. And designers still work to make them better, to this day. I wrote a tutorial teaching non-technical folks to use a rest API. It required no knowledge beyond familiarity with using web browsers, and ended with people making useful queries with curl. It was short, visual, and effective- I learned that multiple non-profits at the time used it in their materials to teach folks technical literacy. Just because using a bunch of terse jargon is easier for developers to write and acceptable for other developers to read doesn't mean it's optimal... Or even good. Especially when the realm world be much more accessible to non-technical people if it was designed better.
- j16sdiz 3y agoBIND expose (almost) every details of DNS. That's why learning their config would teach you 90% of the DNS system. dig output make sense after reading the RFC. It exposes every bit flag in the protocol level
- jeroenhd 3y agoI have read the RFC. I just don't mess with DNS often enough that I know all the RFC definitions from the top of my head, and I don't want to need to find the appropriate RFC(s) every time I want to debug an issue. It's not as if tools like wget bother you with http/3 spec fields every time you download something from the internet unless you explicitly ask for them, and even if they do, they're more descriptive than just the shortcode coming from a diagram in the RFC.
- bombcar 3y ago>I just don't mess with DNS often enough That's the root of all this, we only deal with DNS when something breaks, and it rarely breaks. If we did DNS all day every day it'd all be super clear and concise.
- mst 3y agoI learned DNS a bit over 20 years ago running a BIND deployment that was authoritative for somewhere over 30k customer domains. I still tend to use nslookup over dig (yes, I know, bad mst) because I got sufficiently used to the former that I barely notice it's even there when using it - my fingers and brain are so used to it that the interface part of nslookup is mentally invisible (though I always teach other people 'dig' and 'host' instead). I'm not sure learning it that way was exactly easier, but being (somewhat, that was far from the only service I was responsible for) immersed in it meant I at least got through the initial mental scrabbling in a relatively compressed time frame, and once you've got a coherent model built in your head life is easier. I think this is really a very long way to say "based on doing DNS most days for a few years, I strongly suspect you're right."
- 3y ago
- j16sdiz 3y agorcvd, qr, rd, ra are defined in the RFC. It need the abbreviation to fit in the ASCII art in RFC text. back in those days, dig users are those who read rfc
- jeroenhd 3y agoI can see that they were truncated in the block diagram, but they were also explained with one or two words just lines below that. RFC1035 calls them "query"/"response", "authoritative answer", "Truncation", "Recursion Desired", "Recursion Available", and CD/AD become "Checking Disabled" and "Authentic Data". dig already translates things like record types from integers to strings, why not use the full, descriptive names for these flags as well? Why shouldn't I be able to dig +pretty domain.example? I suppose dig is mostly maintenance mode these days, but it's quite annoying to see so many tools rely on it when it's so... 90s.
- alphager 3y agoYou've gut the nail on the head: dig was designed with the needs of the 90s in mind, where terseness was a virtue (if your ram can be usefully conveyed in kilobytes, you need terse tools). Due to backwards compatibility, the output won't be changed. Due to backwards compatibility, stuff is the tool that's installed by default. Both can't be changed (it would break too many assumptions many scripts and programs have). However, there are multiple dig alternatives. You just have to install them.
- mst 3y agoI liked jvns' suggestion to add a +human option - plenty of tools have a -h output option which is nicer for quick interactive use, and I value their existence (e.g. I use both 'du -h' and 'du -k' semi regularly depending on if I want to read the results or throw it through an analysis script).
- zehemer 3y ago> As a user of the "--color" flag for the `ip` command, I'd love to see tools like dig produce more modern output https://github.com/ogham/dog https://github.com/ogham/dog is pretty good in that regard
- zhfliz 3y agowow, didn't know about `ip --color`, that's awesome
- manuel_w 3y ago$ ip address --color Command "--color" is unknown, try "ip address help".
- matteotom 3y agotry > ip --color address otherwise you might just have an old version
- mst 3y agoSome CLI apps with subcommands accept top level options anywhere in the arguments, some - like 'ip' - expect <command> <command options> <subcommand name> <subcommand options> <arguments> The advantage of that approach is that you don't have to worry about naming collisions between the command and subcommand option sets, which can be really handy - especially in applications with pluggable and/or user supplied subcommands, so you can add top level options without worrying about breaking somebody else's extensions. The disadvantage is, well, what just happened to you. (note that I personally really like the pedantic approach because it fits my brain, but I'm -not- trying to endorse it as better in general since it's very definitely a trade-off and one that often isn't a good one overall)
- dataflow 3y agoTo the extent I learned DNS, it was via nslookup, definitely not dig.
- firexcy 3y agoI think old CLI tools are hard to use because they were designed to be machine- and human-readable at the same time. They are effectively APIs in some scenarios (e.g., scripting and as linked libraries) and in others handholds. As a result they are restricted to be barely viable as either.