Use it when creating or checking records, when mail or a service cannot be found, or when a change takes a long time to be seen.
DNS Resource Record Field Reference
1. dig <name> <type> @<authoritative server> +norecurse — is the record there, with the right data?
2. dig <name> <type> through the resolver — same answer? If not, how much time to live remains?
3. Mail failing → dig <domain> MX, then check that each target has an address record.
4. A CNAME where other records are needed → not allowed; use address records.
record exists on the zone's servers with the right type and data → resolvers fetch it → cached copies expire within the time to live → clients receive the current record
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
dig www.example.com AVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational verification Verify boundary
dig www.example.com A
dig example.com MX +short
dig example.com TXT +short
dig -x 192.0.2.10
dig www.example.com A @ns1.example.com +norecurse
In dig output, each record is printed as name, TTL, class, type, data. Asking a resolver shows the remaining TTL counting down in its cache; asking the zone's own server shows the configured TTL. -x does a reverse lookup. A CNAME shows in the answer section followed by the records of the name it points to.
Known-good: the record of the expected type is returned with the intended data, from the zone's own servers and from the resolver in use.
Step 2 Failure isolation workflow Narrow the fault
- A change is not visible. Caches still hold the old record; compare the answer from the zone's own server with the resolver's, and note the TTL.
- A CNAME at the zone's top level is rejected or breaks mail. It is not allowed there; use address records or the provider's alias feature.
- Mail does not arrive. The MX points to a name without an address record, to a CNAME, or to an IP address.
- A name resolves to something with the zone name appended twice. A missing trailing dot in the zone file.
- A service is not found. The SRV record's name — service and protocol labels included — or its port is wrong.
- Reverse lookups fail. The PTR record lives in a different zone, usually managed by whoever owns the address range.
- Some clients get one address, others another. Several address records exist for the name; that is rotation, not a fault.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
A name with a CNAME can have no other records — so no CNAME at the top of a zone. MX and NS must point to names with address records, not to aliases or IP addresses. A change becomes visible as caches expire: up to one full time to live.
dig <name> A/AAAA/MX/TXT— the records with their time to live.dig <domain> MX +short— just the data.dig -x <address>— reverse lookup.dig <name> A @<authoritative server> +norecurse— the configured record and its full time to live.
ReferenceWhat it is1 section · depth on demand
Mechanics & mental model
All DNS data is stored and sent as resource records. Every record has the same outer form — a name, a type, a class, a time to live and the data — and the type decides what the data part contains: an address, another name, a mail server with a preference, and so on.
ReferenceWhy it matters1 section · depth on demand
ReferenceHow it works1 section · depth on demand
How it works
The common form.
| Field | Meaning |
|---|---|
| Name | The name the record belongs to (the owner) |
| Type | What kind of data follows |
| Class | IN (Internet) in practice |
| TTL | Seconds a resolver may keep the record in its cache |
| Data | Depends on the type |
Common types.
| Type | Data | Example |
|---|---|---|
| A | An IPv4 address | www 3600 IN A 192.0.2.10 |
| AAAA | An IPv6 address | www 3600 IN AAAA 2001:db8::10 |
| CNAME | Another name: "this name is an alias for that one" | shop 3600 IN CNAME www.example.com. |
| MX | A preference and the name of a mail server; lowest preference is tried first | @ 3600 IN MX 10 mail.example.com. |
| NS | The name of a server responsible for the zone | @ 86400 IN NS ns1.example.com. |
| SOA | Administrative data about the zone | one per zone |
| PTR | A name, for looking up an address in reverse | 10.2.0.192.in-addr.arpa. IN PTR www.example.com. |
| SRV | Priority, weight, port and server name for a service | _sip._tcp 3600 IN SRV 10 60 5060 sip.example.com. |
| TXT | Free text; used for SPF, domain verification and similar | @ IN TXT "v=spf1 mx -all" |
Rules that cause the common errors.
- A CNAME stands alone. A name that has a CNAME cannot have any other record. For that reason a CNAME cannot be placed at the top of a zone, which always has SOA and NS records.
- MX and NS point to names with address records — not to an IP address, and not to a CNAME.
- A trailing dot matters in zone files.
mail.example.com.is complete;mail.example.comwithout the dot has the zone name appended. - Several records of the same name and type form a set and are returned together, usually in rotating order. They share one TTL.
TTL. A resolver that has fetched a record answers from its cache until the TTL runs out and does not ask again in between. A change therefore becomes visible gradually, as caches expire — up to one full TTL after the change. Lowering the TTL helps only if done at least one old TTL before the change.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Resource record structure
All DNS data is stored and sent as resource records with one common outer format. RFC 1035 defines the fields:
- NAME: the owner name.
- TYPE (2 bytes): the record type.
- CLASS (2 bytes): almost always IN.
- TTL (32-bit unsigned): how many seconds the record may be cached, where 0 means don't cache.
- RDLENGTH (16 bits): the length of the data.
- RDATA: the data itself, whose format depends on the type.
Common record types
| Type | Number | RDATA | Source |
|---|---|---|---|
| A | 1 | IPv4 address | RFC 1035 |
| NS | 2 | Name server name | RFC 1035 |
| CNAME | 5 | Canonical name | RFC 1035 |
| SOA | 6 | Zone parameters | RFC 1035 |
| PTR | 12 | Name (reverse lookups) | RFC 1035 |
| MX | 15 | Preference + mail server name | RFC 1035 |
| TXT | 16 | Text strings | RFC 1035 |
| AAAA | 28 | IPv6 address | RFC 3596 |
| SRV | 33 | Priority, weight, port, target | RFC 2782 |
| OPT | 41 | EDNS pseudo-record | RFC 6891 |
| DS, RRSIG, NSEC, DNSKEY | 43, 46, 47, 48 | DNSSEC | RFC 4034 |
Name compression (RFC 1035)
Names in a message can point back to an earlier occurrence instead of being repeated. A pointer is two bytes: the first two bits are 1, and the remaining 14 bits give the offset from the start of the message. That is why c0 0c appears so often in hex dumps. It points to offset 12, the question name.
host$ dig www.example.net A +noall +answer
www.example.net. 287 IN A 192.0.2.40
host$ dig example.net MX +noall +answer
example.net. 3600 IN MX 10 mail1.example.net.
host$ dig example.net TXT +short | grep spf
host$ dig -x 192.0.2.40 +short
www.example.net.
host$ tshark -r dns.pcap -Y "dns.flags.response==1" -T fields -e dns.resp.name -e dns.resp.type -e dns.resp.ttl | head
Reading TTLs
The TTL in an answer from a recursive resolver counts down while the record sits in the cache. Two queries a minute apart show TTLs about 60 seconds lower. The authoritative server always returns the full configured TTL. That makes it easy to tell whether an answer came from cache.
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → DNS Resource Record Field Reference. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc1034.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Operational notes
Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.
DNS RR Fields
NAME/TYPE/CLASS/TTL/RDATA.
30-second lookup
- Open Packet Field Explorer for field-level metadata.
- Use Packet Decoders for bit/flag values where relevant.
- Use Paste Output / Structured Parser for CLI evidence.
- Use Packet Filters to prove the wire boundary.
Evidence rule
A decoded field proves what is present in that packet/output at that moment. Continue through the verification chain before concluding end-to-end behavior.