Table of Contents
dig (domain information groper) is invaluable for name resolution queries. Although you could also use
dig just feels more modern and snappier.
This guide shows some common use cases for
How to determine which name servers a domain is using
dig +short @220.127.116.11 NS vander.host
How to get the serial number with dig
dig +multi vander.host soa | grep 'serial' dig +short vander.host soa
+short is useful because it suppresses the huge amount of output dig provides.
Always Using +Short
One catch with dig is sheer overwhelming amount of output it produces. Sometimes it’s better to always use dig with the +short option so that you can only see relevant output. To enable
dig to always produce the abbreviated output, add this Bash shell alias:
alias dig="dig +short"
To unset it again:
On some Ubuntu minimal installations the
dig command won’t be installed by default. This means you will be unable to perform name resolution troubleshooting. Dig is part of ‘dnsutils’ so you can install it like so:
sudo apt-get install dnsutils