Dig – Domain Information Groper is a light weight Linux utility for querying DNS records. It is widely used to diagnose DNS servers, troubleshoot DNS servers, purge DNS Cache using external DNS server and dozen of great features it provides.
Here i am sharing quick cheat sheet of dig – DNS Lookup utility that every System/Network administrator should have print out at their desk.
In these examples, 22.214.171.124 is a Google Public DNS Server that you can use in
Why to use Google Public DNS ?
If you have a DNS record with high ttl e.g 3600 seconds, your local DNS server may not purge the old record from the cache. So better you use Google public DNS server to resolve it most recent update record.
To set google public dns as default resolver, run below command;
NOTE : This will override your resolv.conf
echo “nameserver 126.96.36.199” > /etc/resolv.conf
Lookup different DNS records type using ‘dig’ :
Sample usage :
dig @dns-server example.com record-type
dig @188.8.131.52 hackersgarage.com A
Simple lookup :
Lookup Name Servers
dig @184.108.40.206 hackersgarage.com NS
Lookup using external DNS Server.
dig @220.127.116.11 hackersgarage.com
Lookup MX record
dig @18.104.22.168 hackersgarage.com MX
Lookup CNAME record
dig @22.214.171.124 hackersgarage.com CNAME
Look TXT record (e.g will it will return SPF records, google verification methods)
dig @126.96.36.199 hackersgarage.com TXT
- How to share on linux the output of your shell commands
- An introduction to systemd for CentOS 7
- Linux Games: Sanctum 2
- What goes around comes around: nearly half of DDoS attacked companies are hit twice or more
- How to check if you are vulnerable to shellshock
Find me on Google+