Query DNS servers for records and debug DNS resolution.
low risk
dig (domain information groper) queries DNS servers and displays detailed responses including record type, TTL, and which server responded. The go-to tool for DNS debugging — far more informative than nslookup.
| Flag | Meaning |
|---|---|
+short | Print only the answer, no headers |
+noall +answer | Show only the answer section |
@server | Query a specific DNS server |
-x | Reverse DNS lookup |
-t | Specify record type (A, AAAA, MX, TXT, NS, CNAME, SOA) |
dig eknathalabs.com A +shortQuick A record lookup · explain & risk-check →dig @8.8.8.8 eknathalabs.com TXTQuery Google DNS for TXT records · explain & risk-check →dig -x 1.1.1.1 +shortReverse DNS: IP to hostname · explain & risk-check →dig eknathalabs.com MX +noall +answerShow MX records cleanly · explain & risk-check →dig +trace eknathalabs.comFull DNS resolution chain from root · explain & risk-check →Use `dig +trace` to follow the full resolution path from root servers — reveals exactly which DNS server is serving stale or incorrect records during a propagation issue.
Reference text is hand-written and may be incomplete — check man dig for your version. Test destructive commands on a non-production system first.