Pcornel
Networking · IP Services

DNS (Domain Name System)

Cheat sheet · https://pcornel.dk/topic.php?topic=656

Back to the Topic

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> — resolution
  • dig <name> +trace — delegation path
  • show hosts — cached names on IOS
  • show 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.
dig
nslookup

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 conceptReference meaning
Recursive resolverFinds/caches answers for clients
Authoritative serverPublishes source data for a zone
TTLCache lifetime for an RRset
CNAMEAlias to another canonical name
NXDOMAINName 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

Confirmation

Confirm action

Continue?