DNS Diagnostics with dig and nslookup
Diagnose name-resolution problems on Linux using dig, nslookup, and host to inspect DNS records, trace resolution paths, and spot misconfigurations.
Why DNS Diagnostics Matter
Many 'network is down' reports are really DNS failures. The host is reachable by IP, but the name will not resolve.
Linux ships tools to inspect resolution directly:
dig— flexible, scriptable lookupsnslookup— classic interactive toolhost— quick one-line answers
This lesson focuses on reading their output to find the real problem.
A Basic dig Query
Run dig followed by a hostname to fetch its A record.
The key part of the output is the ANSWER SECTION, which lists the resolved addresses and their TTL.
dig example.comAll lessons in this course
- Packet Capture with Wireshark/tcpdump
- Network Performance Tools
- Linux Firewall (Netfilter/iptables)
- DNS Diagnostics with dig and nslookup