DNS works because several parts share the load. Once you know their names, error messages and tool output make far more sense.
Stub and recursive resolvers
The stub resolver is the small piece on your own machine, usually part of the C library or a local service. It does not search the DNS tree itself. It passes the question to a recursive resolver, run by your router, your provider or a public service. The recursive resolver does the searching and returns a final answer.
Name servers
An authoritative name server holds the official data for part of the DNS tree. There are three layers you will meet:
- Root servers know which servers handle each top-level domain. There are 13 root server names,
atom, served by many machines around the world. - TLD servers handle a top-level domain such as
organd know the name servers for domains under it. - Domain name servers hold the actual records for a domain.
Zones
A zone is the portion of the namespace that one set of authoritative servers manages. A domain and a zone are not always the same. If example.com delegates lab.example.com to other servers, the subdomain becomes its own zone, although it is still part of the domain.
Zone data is often written in a zone file:
$TTL 3600
@ IN SOA ns1.example.test. admin.example.test. ( 1 7200 900 1209600 300 )
@ IN NS ns1.example.test.
ns1 IN A 192.0.2.1
www IN A 192.0.2.10
web IN CNAME wwwHere @ means the zone's own name.
Common record types
| Type | Holds |
| --- | --- |
| A | IPv4 address |
| AAAA | IPv6 address |
| CNAME | alias pointing to another name |
| MX | mail server and its preference |
| NS | authoritative name server |
| SOA | zone's start of authority, including a serial number |
| PTR | name for an address (reverse lookup) |
| TXT | free text, often used for verification |
TTL
Every record has a time to live (TTL) in seconds. Resolvers may cache the answer for that long. You can watch it in dig output, where the second column counts down on repeated queries to a cache:
$ dig +noall +answer example.com A
example.com. 287 IN A 192.0.2.80The address shown is a documentation placeholder, so yours will differ. A long TTL means fewer queries but slower changes.
Try it
- Run
dig +short . NSto list the root server names. - Run
dig +short org NSto see the servers for a TLD. - Run
dig +noall +answer example.com Atwice and compare the TTL values.
Check your understanding
DNS Components
All 5 sections ยท no timer
Unlimited retries
Questions from every section are combined into one assessment. Answer them all correctly to complete the article.
Your completion saves in this browser. Sign in to sync it to your account.