Networking · IP Services
DNS (Domain Name System)
Cheat sheet · https://pcornel.dk/topic.php?topic=656
Answer
DNS resolves names through recursive resolvers, authoritative servers, caches and typed resource records.
Remember
- A/AAAA map names to IPv4/IPv6; CNAME aliases one name; PTR is reverse lookup
- Recursive and authoritative roles answer different questions
- UDP 53 is common, while TCP 53 is required for some large replies and zone operations
- NXDOMAIN, NODATA, SERVFAIL and timeout indicate different boundaries; TTL controls cache lifetime.
First checks
nslookup <name>— resolutiondig <name> +trace— delegation pathshow hosts— cached names on IOSshow running-config | include name-server— device resolvers
Commands
Get-DnsClientServerAddress- Display configured DNS resolvers per interface.
resolvectl status- Shows systemd-resolved DNS servers, domains and per-link resolver state.
dig <name> <type> +noall +answer +authority +additional- Inspect DNS sections and TTL/RR data.
ip name-server <dns-server>- Set the DNS server used for host name lookups.
ip domain lookup- Enable DNS lookups of host names typed at the CLI (default on).
show hosts- Display the host name cache and configured DNS servers.
dig +trace <name> [type]- Trace iterative delegation from root toward authoritative servers.
dig +tcp <name> [type] @<server>- Force DNS over TCP to compare with UDP/truncation behavior.
dig +dnssec <name> <type> @<server>- Request DNSSEC records/flags and inspect AD/RCODE/RRSIG context.
tcpdump -ni <iface> port 53- Capture DNS over UDP/TCP on an interface.
Resolve-DnsName <name> -Type <type> -Server <server>- Query a specific DNS server and inspect returned records/errors.
dignslookup
Verify in this order
client → resolver → recursion → authoritative → answer cached
Where it usually breaks
local configuration → reachability/transport → request/negotiation → server or policy decision → response/state installation → client-visible result
DNS · reference boundaries
| DNS concept | Reference meaning |
|---|---|
| Recursive resolver | Finds/caches answers for clients |
| Authoritative server | Publishes source data for a zone |
| TTL | Cache lifetime for an RRset |
| CNAME | Alias to another canonical name |
| NXDOMAIN | Name does not exist (not the same as empty answer) |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=656