Skip to main content

dig - DNS Lookup Utility

The dig is a powerful CLI to find out information about domains and IP addresses without using any 3rd party tools or websites. 

01. What is the website’s IP address?


 02. How do you identify the name servers(NS) associated with a domain? 

dig NS +short 
dig NS com. +short

03. Which eMail Servers(MX) are responsible for a domain? 

dig MX +short

04. Finding out the domain name associated with the IP address (reverse IP lookup) 

dig -x +short 
dig -x +short

05. Finding out the delegation path for any DNS zone (learn how DNS works) 

dig +trace

06. Finding out DNS answers from specific cache resolver (e.g. Cloudflare [], Google DNS [], IBM and so on for domain) 

dig A @ +short 
dig A @ +short

07. Finding out the cache expire time (TTL) for DNS 

# AAAA is for IPv6
dig A +nocmd +noall +answer +ttlid 
dig AAAA +nocmd +noall +answer +ttlid

08. Finding if a zone is synchronized with all authoritative name servers (look for serial number) 

dig +nssearch

09. What is my public IPv4 or IPv6 address? 

dig TXT +short 
dig TXT ch whoami.cloudflare @ +short

10. Getting help about the dig command 

man dig

11. Finding out the IP address associated the domain name.

dig +short | sort -V