Skip to content

Linux Foundations / Follow traffic and find the fault ยท Step 30 of 46

Lesson: DNS ComponentsSwitch
โ† Linux Foundations

Network operations

DNS Components

Meet the resolvers, name servers, zones and records that make up the Domain Name System.

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, a to m, served by many machines around the world.
  • TLD servers handle a top-level domain such as org and 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 www

Here @ 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.80

The address shown is a documentation placeholder, so yours will differ. A long TTL means fewer queries but slower changes.

Try it

  1. Run dig +short . NS to list the root server names.
  2. Run dig +short org NS to see the servers for a TLD.
  3. Run dig +noall +answer example.com A twice 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.