; <<>> DiG 9.16.20 <<>> -r jvns.ca ;; global options: +cmd ;; Got answer:
just try `host goo.gl 1.1.1.1` or `host -t ns google.com` -- it's the output you'd expect without all the verbosity.
; <<>> DiG 9.16.20 <<>> -r jvns.ca ;; global options: +cmd ;; Got answer:
just try `host goo.gl 1.1.1.1` or `host -t ns google.com` -- it's the output you'd expect without all the verbosity.
Most of my co-worker prefer host, but continue to be supprised when I use dig and features like reverse lookup or dig @some-dns-server. I’m sure that host can do the same, but few seems to know how.
As for reverse lookups, it's as simple as host <ip-address>
https://datatracker.ietf.org/doc/html/rfc1035.html#section-5...
# rpm -q -f `which host`
bind-utils-9.16.23-1.fc35.x86_64https://bind9.readthedocs.io/en/latest/manpages.html#host-dn...
> host is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. When no arguments or options are given, host prints a short summary of its command-line arguments and options.
https://bind9.readthedocs.io/en/latest/manpages.html#dig-dns...
> dig is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried. Most DNS administrators use dig to troubleshoot DNS problems because of its flexibility, ease of use, and clarity of output. Other lookup tools tend to have less functionality than dig.
I've seen far too many junior admins accidentally change the hostname of a server when checking a DNS record...
Dig is verbose by default, which is usually what I want. It can be made as terse as host with the +short option. host -vt SOA google.com is more typing than dig google.com SOA. Neither dig or host is very good for use by other programs.
Why are they using a root shell for tasks that don't require it in the first place?
If you just want the answer then `host` is just fine - I use both of them a lot - but `dig` really shines when you need to get into the guts of the DNS.
It’s mostly just habit mixed with the difference in inconvenience being quite small
Also doesn’t host use the local nss stack while dig exclusively queries dns?