DevTools Logo

DNS Records & Lookups Cheat Sheet

DNS record types (A, AAAA, CNAME, MX, TXT, NS, PTR, SOA), lookup commands, and troubleshooting flows.

Web & Network
dns
records
lookup

DNS translates human-readable names into the records that drive routing, email, and service discovery. Each record type answers a different question; knowing which one to query is half the job.

Common record types

Table
TypePurposeExample value
AIPv4 address93.184.216.34
AAAAIPv6 address2606:2800:220:1:248:1893:25c8:1946
CNAMEAlias to another namewww.example.com.
MXMail server + priority10 mail.example.com.
TXTArbitrary text (SPF, DKIM, verification)v=spf1 include:_spf.example.com ~all
NSAuthoritative name serverns1.example.com.
PTRReverse lookup (IP → name)34.216.184.93.in-addr.arpa.
SOAZone authority + serialns1.example.com. hostmaster...
SRVService location (port/weight)10 5 443 sip.example.com.
CAAAllowed certificate authorities0 issue "letsencrypt.org"

Lookup with dig

dig is the standard query tool. It shows the full answer section, authority, and timing by default.

bash
dig example.com
dig example.com A
dig example.com MX
dig example.com TXT
dig example.com NS
dig -x 93.184.216.34          # reverse (PTR)
dig @8.8.8.8 example.com      # query a specific resolver
dig example.com +short        # terse answer only
dig example.com +trace        # follow delegation from the root
Table
FlagMeaning
+shortPrint only the answer values.
+traceShow the full resolution path from root servers.
+noall +answerSuppress everything except the answer section.
@serverQuery a specific DNS server.
-x IPReverse lookup (PTR).

Lookup with nslookup and host

bash
nslookup example.com
nslookup -type=MX example.com
host example.com
host -t TXT example.com

Troubleshooting flow

  1. Confirm the record exists: dig example.com A +short
  2. Check the authoritative server: dig example.com NS +short, then query it directly.
  3. Verify propagation: query multiple public resolvers (8.8.8.8, 1.1.1.1, 9.9.9.9).
  4. Inspect TTL to estimate how long stale caches persist.
  5. Check DNSSEC/validation with dig example.com +dnssec.
Table
SymptomLikely cause
New record not visibleTTL cache, wrong nameserver
NXDOMAINRecord missing or wrong zone
SERVFAILDNSSEC or upstream resolver error
TimeoutFirewall blocking port 53

References