Based on the Linux Master 1 exam syllabusReport an error
named.conf (global options + zone declarations) + zone file (the actual records) structure. Whether a trailing dot is present completely changes how a name is resolved.www.example.com. there is an invisible dot (.), and that is the root.. ← Root (13 root server groups worldwide)
└── com. ← TLD (Top-Level Domain)
└── example.com. ← Second-level domain (unit of registration and management)
└── www.example.com. ← Host (subdomain)
| Level | Name | Responsible party |
|---|---|---|
| Root | . | Root name servers (a~m.root-servers.net) |
| TLD | com, net, org, kr | Registry (Verisign for com) |
| Second-level | example.com | Domain owner (authoritative name server) |
| Host | www, mail | Individual services |
An FQDN (Fully Qualified Domain Name) is the complete name including the root dot at the very end. A trailing dot, as in www.example.com., means "this is an absolute path — nothing more to append". In a zone file, the presence or absence of this one trailing dot completely changes the meaning, so you must use it consciously.
| Aspect | Recursive query | Iterative query |
|---|---|---|
| Who asks | Client → local DNS | Local DNS → upstream servers |
| Responsibility | The server asked is responsible for the final answer | Only gives a referral: "go ask the next server" |
| Result | Returns the finished IP | Returns NS delegation info |
[PC] --recursive--> [Local DNS]
|--iterative--> [Root] "com is over there"
|--iterative--> [com TLD] "example.com is over there"
|--iterative--> [Authoritative server] "www is 93.184.216.34"
[PC] <--final answer-- [Local DNS]
The local DNS keeps every answer it learns in a cache. The retention period is set by each record's TTL (Time To Live, in seconds) value. If the TTL is 3600, it answers from the cache for an hour without asking again. That is why, even after you change a domain's IP, it takes as long as the TTL to spread worldwide. The old (stale) answer that earlier servers hold in their caches is what we call "DNS propagation delay".
| Record | Name | Role | Example |
|---|---|---|---|
| A | Address | Hostname → IPv4 | www A 93.184.216.34 |
| AAAA | quad-A | Hostname → IPv6 | www AAAA 2606:2800:220:1:: |
| CNAME | Canonical Name | Alias → canonical name | ftp CNAME www.example.com. |
| MX | Mail eXchanger | Designates mail server (with priority) | @ MX 10 mail.example.com. |
| NS | Name Server | Authoritative name server for this zone | @ NS ns1.example.com. |
| PTR | Pointer | IP → hostname (reverse) | 34 PTR www.example.com. |
| SOA | Start of Authority | Authority start and management info for the zone | (one at the very top of the zone) |
| TXT | Text | Arbitrary text (SPF, domain verification, etc.) | @ TXT "v=spf1 ..." |
Memory anchors:
ftp is really www. However, you cannot place another record on the name a CNAME is defined for, and in particular you cannot use a CNAME at the top of the domain (@).MX 10 comes before MX 20.⚠️ Trap: You cannot place another record (A, MX, etc.) of the same name alongside a CNAME record. Also, you cannot place a CNAME at the top of the domain (zone apex,
@) — because SOA and NS must be in that spot. A choice saying "make the main domain example.com a CNAME" is a wrong trap option.
$TTL 86400
@ IN SOA ns1.example.com. admin.example.com. (
2026060501 ; Serial (serial number: increase on every change)
3600 ; Refresh (how often the secondary checks for changes, in seconds)
900 ; Retry (retry interval when a check fails, in seconds)
1209600 ; Expire (how long until the secondary discards data if the primary is unreachable, in seconds)
86400 ) ; Minimum (negative caching TTL, in seconds)| Field | Meaning |
|---|---|
| MNAME | Primary authoritative name server (ns1.example.com.) |
| RNAME | Administrator email. Written with @ replaced by . (admin.example.com. = admin@example.com) |
| Serial | Serial number. A secondary server re-fetches the zone only when this number has increased |
| Refresh | How often the secondary asks the primary "anything changed?" |
| Retry | Interval before asking again when a Refresh fails |
| Expire | How long until the secondary throws away its data when the primary keeps not responding |
| Minimum | How long a negative response (nonexistent name) is cached |
Serial usually uses the date-based YYYYMMDDnn format (e.g. 2026060501 = the 1st revision on June 5, 2026). If an admin edits the zone and forgets to increase the Serial, the secondary server never learns of the change and keeps serving old data. This is a common cause of real operational accidents, which is why "if you edited it, bump the Serial first" is rule number one for DNS admins.
named.# Install (RHEL/CentOS family)
yum install bind bind-utils
# Config file locations
/etc/named.conf # Main config (global options + zone declarations)
/var/named/ # Directory where zone files are placed
# Daemon control
systemctl start named
systemctl enable named
# Config syntax check (a must before saving!)
named-checkconf # Check named.conf
named-checkzone example.com /var/named/example.com.zone # Check zonenamed.conf consists of a global options block + zone declarations.options {
listen-on port 53 { any; }; # Listening interfaces
directory "/var/named"; # Base directory for zone files
allow-query { any; }; # Who is allowed to query
recursion yes; # Whether to allow recursive queries
};
zone "example.com" IN {
type master; # master (primary) or slave (secondary)
file "example.com.zone"; # Forward zone file name
};
zone "1.168.192.in-addr.arpa" IN { # Reverse zone
type master;
file "192.168.1.rev";
};| Directive | Role |
|---|---|
directory | Base path where zone files are looked up (/var/named) |
allow-query | Range of clients allowed to query |
recursion | Whether to allow recursive queries. Public servers usually set no |
type master/slave | Whether this server is the owner of the zone or a copy |
file | Zone file name for that zone |
⚠️ Trap:
type masteris the primary server andtype slaveis the secondary server. A slave zone must also includemasters { primary-server-IP; };to say where to fetch data from. Swapping master/slave, or leaving recursion asyeson an externally public server (an open resolver = abused for DDoS amplification), shows up as trap options.
/var/named/example.com.zone:
$TTL 86400
@ IN SOA ns1.example.com. admin.example.com. (
2026060501 3600 900 1209600 86400 )
IN NS ns1.example.com.
IN MX 10 mail.example.com.
ns1 IN A 192.168.1.10
www IN A 192.168.1.20
mail IN A 192.168.1.30
ftp IN CNAME www.example.com.@ is shorthand that refers to the zone name itself (example.com.).In a zone file, if a name does not end with a dot (www), BIND automatically appends the zone name and interprets it as www.example.com. (this is called origin appending). Conversely, ending with a dot like www.example.com. makes it an absolute name as-is. It is safest to write the targets of CNAME, NS, and MX as an FQDN with the trailing dot — if you forget the trailing dot, the classic accident happens where the zone is appended twice, as in mail.example.com.example.com..
in-addr.arpa, in which the IP is written backwards.192.168.1.0/24 is 1.168.192.in-addr.arpa — the IP octets are written in reverse order./var/named/192.168.1.rev:
$TTL 86400
@ IN SOA ns1.example.com. admin.example.com. (
2026060501 3600 900 1209600 86400 )
IN NS ns1.example.com.
10 IN PTR ns1.example.com.
20 IN PTR www.example.com.
30 IN PTR mail.example.com.20 means 20.1.168.192.in-addr.arpa, which corresponds to IP 192.168.1.20.Reverse lookup is key to verifying mail server trustworthiness. A receiving mail server checks whether the sending IP's PTR resolves to a legitimate name, and treats the mail as spam if the PTR is missing or nonsensical. Another difference is that IPv4 uses in-addr.arpa while IPv6 uses ip6.arpa.
dig. dig is the standard diagnostic tool included with BIND.# Look up an A record
dig www.example.com A
# Look up an MX record
dig example.com MX
# Ask a specific DNS server directly
dig @192.168.1.10 www.example.com
# Reverse lookup (-x)
dig -x 192.168.1.20
# Trace mode: shows the chain from the root to the authoritative server
dig +trace www.example.com
# Simple lookups
nslookup www.example.com
host www.example.comdig +trace, the iterative query flow you learned earlier (root → TLD → authoritative server) unfolds right on your screen. It is the best exercise for connecting theory with the real thing.Tomorrow we raise the second pillar of network infrastructure services with DHCP, which distributes IPs automatically, and NTP, which synchronizes time.
www.example.com., it is an absolute name.com or kr. Managed by a registry, which delegates everything below it.@).in-addr.arpa / ip6.arpa : Special domains used for IPv4 / IPv6 reverse lookups.recursion yes is left on an externally public server. It is abused for DDoS amplification, so it must be avoided.Click a choice to reveal the answer and explanation.
Question 1
Which DNS record maps a hostname to an IPv6 address?
Question 2
In an SOA record, which field is the criterion a secondary (slave) server uses to decide whether to fetch the zone data again?
Question 3
Which query style is used when a PC asks the local DNS server to "find out the answer all the way through"?
Question 4
Given the MX records @ MX 10 mail.example.com. and @ MX 20 backup.example.com., which server is tried first for mail?
Question 5
In BIND's named.conf, which setting indicates that this server is the primary server holding the original of the zone?
Question 6
What is the correct name of the reverse (PTR) zone for IP 192.168.1.20?
Question 7
When a name is written without a dot in a zone file, as in www IN A 192.168.1.20, what does BIND automatically do?