dig / nslookup Commands
DNS lookup tools.All dig / nslookup pages
- dig -x IP: reverse DNS lookup (PTR record)dig -x 8.8.8.8 +short looks up the PTR record of an IP address, the host name for reverse DNS. Works for IPv6 too; NXDOMAIN means no PTR record exists for it.
- dig @8.8.8.8 example.com: query a specific DNS serverdig @SERVER name queries the DNS server you choose instead of resolv.conf. Compare resolvers, ask authoritative servers, use another port, TCP or TLS.
- dig example.com MX: look up mail server (MX) recordsdig example.com MX lists a domain's mail servers with their preference numbers. Read the answer, check the targets resolve and handle empty or NXDOMAIN replies.
- dig TXT: check SPF, DMARC and domain verification TXT recordsdig TXT +short shows SPF, DMARC, DKIM and verification records. The exact name for each, finding duplicate SPF records, long split strings and propagation.