Using dig, nslookup, host and traceroute

Updated: 2026-05-30

dig (recommended)

dig example.com A          # A record
dig example.com MX +short  # concise MX
dig @8.8.8.8 example.com   # query a specific resolver
dig -x 8.8.8.8             # reverse (PTR)

Prefer a browser? The DNS Lookup tool does the same instantly.

nslookup / host

nslookup example.com
host example.com

traceroute / mtr (path analysis)

traceroute example.com   # each hop along the path
mtr example.com          # traceroute + ping, live

tcpdump (packet capture)

sudo tcpdump -i eth0 host 8.8.8.8   # traffic to/from an IP
sudo tcpdump -i any port 53         # DNS traffic

traceroute and tcpdump may be restricted by privileges or network policy. Only inspect systems you are authorized to.

Sources