Skip to content

Names, zones, and records

Module
How DNS Finds Services
Difficulty
Easy
Updated
Tested on
Ubuntu 24.04.5 LTS, netlab 1.1, GNU Bash 5.2.21
On this page

You have been typing 10.77.20.80 to reach the lab web server. The course began with a name. Find the address for the lab’s name, then ask questions that an address alone cannot answer.

Finish Getting Network Settings Automatically. Use the Ubuntu VM from Installing the lab. Exit any machine shells. Earlier modules left their modes off. If netlab status shows dhcp or nat on, turn it off with netlab mode <name> off.

Seven questions from laptop to web A horizontal line joins laptop to web through seven numbered circles. Station 2 is the focus. It asks which machine has the name web.lab.test. laptop web 1 2 3 4 5 6 7
Seven questions from laptop to web A horizontal line joins laptop to web through seven numbered circles. Station 2 is the focus. It asks which machine has the name web.lab.test. laptop web 1 2 3 4 5 6 7
Station 2 asks which machine has the name web.lab.test.

If you installed netlab 1.0, run these commands on the Ubuntu VM. The checksum should pass before you unpack the download. Use your Ubuntu password when prompted.

Terminal window
wget https://rootvolt.dev/downloads/netlab-1.1.tar.gz
wget https://rootvolt.dev/downloads/netlab-1.1.tar.gz.sha256
sha256sum -c netlab-1.1.tar.gz.sha256
tar -xzf netlab-1.1.tar.gz
sudo sh netlab-1.1/install.sh
netlab reset

Version 1.1 lets you look up a name from an address and observe a stored answer after a record changes. The installer and reset complete the upgrade. From the VM prompt, check the version, turn on the mode, and reset to start with a clean lab. Keep this mode on throughout the module.

Check netlab and turn on DNS
learner@rootvolt:~$ netlab versionnetlab 1.1 (cast f4462821f3d4)learner@rootvolt:~$ netlab mode dns on[sudo] password for learner: Mode dns is on: dns and ns run; lab machines use 10.77.20.53.learner@rootvolt:~$ netlab resetLab is back in its starting state (modes on: dns).learner@rootvolt:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.1), GNU Bash 5.2.21. The VM confirms netlab 1.1 and starts the lab in DNS mode.
Steps (12)
  1. Type netlab version
  2. Press Enter
  3. Output: netlab 1.1 (cast f4462821f3d4)
  4. Type netlab mode dns on
  5. Press Enter
  6. Output: [sudo] password for learner:
  7. Type the password (the terminal shows nothing)
  8. Press Enter
  9. Output: Mode dns is on: dns and ns run; lab machines use 10.77.20.53.
  10. Type netlab reset
  11. Press Enter
  12. Output: Lab is back in its starting state (modes on: dns).

Run netlab shell laptop from the VM and then dig web.lab.test on laptop. The dig program asks a question using the Domain Name System (DNS), the system that stores and answers questions about names.

Read a complete lookup
learner@laptop:~$ dig web.lab.test
; <<>> DiG 9.18.39-0ubuntu0.24.04.9-Ubuntu <<>> web.lab.test
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46190
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;web.lab.test.			IN	A

;; ANSWER SECTION:
web.lab.test.		300	IN	A	10.77.20.80

;; AUTHORITY SECTION:
lab.test.		300	IN	NS	ns.lab.test.

;; Query time: 4 msec
;; SERVER: 10.77.20.53#53(10.77.20.53) (UDP)
;; WHEN: Sun Nov 29 13:42:27 UTC 2026
;; MSG SIZE  rcvd: 90learner@laptop:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.1), GNU Bash 5.2.21. The full output shows the question, the answer, and the server that replied.
Steps (3)
  1. Type dig web.lab.test
  2. Press Enter
  3. Output: ; <<>> DiG 9.18.39-0ubuntu0.24.04.9-Ubuntu <<>> web.lab.test ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46190 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ;; QUESTION SECTION: ;web.lab.test. IN A ;; ANSWER SECTION: web.lab.test. 300 IN A 10.77.20.80 ;; AUTHORITY SECTION: lab.test. 300 IN NS ns.lab.test. ;; Query time: 4 msec ;; SERVER: 10.77.20.53#53(10.77.20.53) (UDP) ;; WHEN: Sun Nov 29 13:42:27 UTC 2026 ;; MSG SIZE rcvd: 90

Find QUESTION SECTION and ANSWER SECTION. The first says what was asked. By default this command asks for an IPv4 address. The second gives the result. The SERVER line near the bottom tells you who replied. Step through the excerpt to match each part to its job.

Read a DNS question and answer

;web.lab.test.			IN	A

;; ANSWER SECTION:
web.lab.test.		300	IN	A	10.77.20.80
laptop
machine
eth0
Nameweb.lab.test.
Seconds300
ClassIN
TypeA
Data10.77.20.80

Reading the output

Pick a step to match a marked part of the output to the picture.

Step-by-step reading of a captured output · Output of dig web.lab.test on laptop, on Ubuntu 24.04.5 LTS, netlab 1.1. The values are the capture's. Read the captured question and the answer one field at a time.
Steps (6)
  1. Question. Question: ;web.lab.test. IN A. Shown on laptop's eth0 as: laptop. The client asks for an IPv4 address for this name.
  2. Name. Name: web.lab.test.. Shown on laptop's eth0 as: Name. The record is about this name.
  3. Seconds. Seconds: 300. Shown on laptop's eth0 as: Seconds. Caching and TTLs explains this count.
  4. Class. Class: IN. Shown on laptop's eth0 as: Class. IN is the Internet class.
  5. Type. Type: A. Shown on laptop's eth0 as: Type. A means this record gives an IPv4 address.
  6. Data. Data: 10.77.20.80. Shown on laptop's eth0 as: Data. This is the IPv4 address in the answer.

A domain name is a sequence of labels separated by dots that names a place in DNS. The final dot in web.lab.test. marks the root. Start there, move down to test, then to lab, then to web. You can leave the final dot off in these commands.

A record is one fact about a name. Its type tells you what kind of fact it holds. The answer shows A for the type and 10.77.20.80 for the data. The number before IN is in seconds. Caching and TTLs explains it. The class IN means Internet.

A zone is the part of the name hierarchy whose records a server holds and serves. Here ns holds the zone lab.test, with names such as web, www, dns, and ns beneath it.

From the root to lab.test The root leads to test and then to lab. The labels web, www, dns and ns sit below lab inside the lab.test zone held by ns. The zone lab.test, held by ns Root (.) test lab web www dns ns
From the root to lab.test The root leads to test and then to lab. The labels web, www, dns and ns sit below lab inside the lab.test zone held by ns. The zone lab.test, held by ns Root (.) test lab web www dns ns
Simplified model. From the root through test to the lab.test zone held by ns.

@10.77.20.54 sends the question straight to ns, the machine that holds the zone. A lookup without @ uses the usual server. The next lesson explains the difference. AXFR asks for a copy of the zone. The options +noall +answer hide the usual output sections and show the answer records.

Read the lab zone from ns
learner@laptop:~$ dig @10.77.20.54 lab.test AXFR +noall +answerlab.test.		300	IN	SOA	ns.lab.test. hostmaster.ns.lab.test. 1795959777 1200 180 1209600 300
lab.test.		300	IN	NS	ns.lab.test.
lab.test.		300	IN	MX	10 web.lab.test.
lab.test.		300	IN	TXT	"RootVolt networking lab"
www.lab.test.		300	IN	CNAME	web.lab.test.
phone.lab.test.		300	IN	A	10.77.10.11
web.lab.test.		300	IN	A	10.77.20.80
web.lab.test.		300	IN	AAAA	fd85:b2a8:3761:20:77:20ff:fe00:80
dns.lab.test.		300	IN	A	10.77.20.53
ns.lab.test.		300	IN	A	10.77.20.54
laptop.lab.test.	300	IN	A	10.77.10.10
router.lab.test.	300	IN	A	10.77.20.1
lab.test.		300	IN	SOA	ns.lab.test. hostmaster.ns.lab.test. 1795959777 1200 180 1209600 300learner@laptop:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.1), GNU Bash 5.2.21. The server at 10.77.20.54 returns the zone records, with an SOA at each end.
Steps (3)
  1. Type dig @10.77.20.54 lab.test AXFR +noall +answer
  2. Press Enter
  3. Output: lab.test. 300 IN SOA ns.lab.test. hostmaster.ns.lab.test. 1795959777 1200 180 1209600 300 lab.test. 300 IN NS ns.lab.test. lab.test. 300 IN MX 10 web.lab.test. lab.test. 300 IN TXT "RootVolt networking lab" www.lab.test. 300 IN CNAME web.lab.test. phone.lab.test. 300 IN A 10.77.10.11 web.lab.test. 300 IN A 10.77.20.80 web.lab.test. 300 IN AAAA fd85:b2a8:3761:20:77:20ff:fe00:80 dns.lab.test. 300 IN A 10.77.20.53 ns.lab.test. 300 IN A 10.77.20.54 laptop.lab.test. 300 IN A 10.77.10.10 router.lab.test. 300 IN A 10.77.20.1 lab.test. 300 IN SOA ns.lab.test. hostmaster.ns.lab.test. 1795959777 1200 180 1209600 300

Ask individual questions to find the same kinds of information without reading the whole zone. Specify the type after the name. An A record gives an IPv4 address. An AAAA record gives an IPv6 address. A CNAME record points an alias to another name. An MX record names a mail server for a domain and gives its preference number.

Find addresses and an alias
learner@laptop:~$ dig web.lab.test A +noall +answerweb.lab.test.		300	IN	A	10.77.20.80learner@laptop:~$ dig web.lab.test AAAA +noall +answerweb.lab.test.		300	IN	AAAA	fd85:b2a8:3761:20:77:20ff:fe00:80learner@laptop:~$ dig www.lab.test CNAME +noall +answerwww.lab.test.		300	IN	CNAME	web.lab.test.learner@laptop:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.1), GNU Bash 5.2.21. Look up both address types for web and the name that www points to.
Steps (9)
  1. Type dig web.lab.test A +noall +answer
  2. Press Enter
  3. Output: web.lab.test. 300 IN A 10.77.20.80
  4. Type dig web.lab.test AAAA +noall +answer
  5. Press Enter
  6. Output: web.lab.test. 300 IN AAAA fd85:b2a8:3761:20:77:20ff:fe00:80
  7. Type dig www.lab.test CNAME +noall +answer
  8. Press Enter
  9. Output: www.lab.test. 300 IN CNAME web.lab.test.

Predict. Which record type would you ask for to find where mail for lab.test goes?

Find the mail host
learner@laptop:~$ dig lab.test MX +noall +answerlab.test.		300	IN	MX	10 web.lab.test.learner@laptop:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.1), GNU Bash 5.2.21. The mail lookup names web.lab.test as the mail host.
Steps (3)
  1. Type dig lab.test MX +noall +answer
  2. Press Enter
  3. Output: lab.test. 300 IN MX 10 web.lab.test.
Check your answer

Ask for MX. The answer gives preference 10 and the host web.lab.test..

A TXT record holds text. An NS record names a server for the zone. An SOA (start of authority) record opens the zone. It names the zone’s main server, a contact name, and numbers that control timing. One of them, the serial number, changes in this lab every time the lab starts. A PTR record can map an address back to a name. Use dig -x with an address to ask that reverse question.

Find text, zone information, and a name by address
learner@laptop:~$ dig lab.test TXT +noall +answerlab.test.		300	IN	TXT	"RootVolt networking lab"learner@laptop:~$ dig lab.test NS +noall +answerlab.test.		300	IN	NS	ns.lab.test.learner@laptop:~$ dig lab.test SOA +noall +answerlab.test.		300	IN	SOA	ns.lab.test. hostmaster.ns.lab.test. 1795959882 1200 180 1209600 300learner@laptop:~$ dig -x 10.77.20.80 +noall +answer80.20.77.10.in-addr.arpa. 300	IN	PTR	web.lab.test.learner@laptop:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.1), GNU Bash 5.2.21. Read the zone text, server and SOA, then find the name for the web address.
Steps (12)
  1. Type dig lab.test TXT +noall +answer
  2. Press Enter
  3. Output: lab.test. 300 IN TXT "RootVolt networking lab"
  4. Type dig lab.test NS +noall +answer
  5. Press Enter
  6. Output: lab.test. 300 IN NS ns.lab.test.
  7. Type dig lab.test SOA +noall +answer
  8. Press Enter
  9. Output: lab.test. 300 IN SOA ns.lab.test. hostmaster.ns.lab.test. 1795959882 1200 180 1209600 300
  10. Type dig -x 10.77.20.80 +noall +answer
  11. Press Enter
  12. Output: 80.20.77.10.in-addr.arpa. 300 IN PTR web.lab.test.

The PTR answer comes from a separate zone for reverse lookups. The zone copy above covers the forward names under lab.test.

Record type What it answers Example from the lab
A IPv4 address 10.77.20.80
AAAA IPv6 address fd85:b2a8:3761:20:77:20ff:fe00:80
CNAME Target name of an alias web.lab.test.
MX Mail server and preference 10 web.lab.test.
TXT Text for a name RootVolt networking lab
NS Server for the zone ns.lab.test.
SOA Basic zone information ns.lab.test. and a serial number
PTR Name for an address web.lab.test. for 10.77.20.80

“A name is an address.” The address replay shows two addresses for web.lab.test, one under each address type.

“One name, one machine.” The alias www.lab.test and the mail record for lab.test both point to web.lab.test. Read the type before deciding what that relationship means.

.test is a top-level name reserved for testing under RFC 6761. That is why the lab uses it. A lab name such as web.lab.test can never collide with a public site.

On laptop, choose a type for each question and run the lookup. Use the short output options. For the address-to-name case, use the reverse form you tried above.

  1. What IPv4 address does phone.lab.test have?
  2. Which name goes with 10.77.10.10?
  3. What does a question for an IPv6 address at www.lab.test return?
  4. Which server holds lab.test?
Solution

Use A, PTR, AAAA and NS in that order. In the third lookup, read both lines. The alias gives you the name to which the IPv6 address belongs.

Find the machine address and reverse name
learner@laptop:~$ dig phone.lab.test A +noall +answerphone.lab.test.		300	IN	A	10.77.10.11learner@laptop:~$ dig -x 10.77.10.10 +noall +answer10.10.77.10.in-addr.arpa. 300	IN	PTR	laptop.lab.test.learner@laptop:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.1), GNU Bash 5.2.21. Find the phone's IPv4 address and the name associated with the laptop address.
Steps (6)
  1. Type dig phone.lab.test A +noall +answer
  2. Press Enter
  3. Output: phone.lab.test. 300 IN A 10.77.10.11
  4. Type dig -x 10.77.10.10 +noall +answer
  5. Press Enter
  6. Output: 10.10.77.10.in-addr.arpa. 300 IN PTR laptop.lab.test.
Read the alias and zone server
learner@laptop:~$ dig www.lab.test AAAA +noall +answerwww.lab.test.		300	IN	CNAME	web.lab.test.
web.lab.test.		300	IN	AAAA	fd85:b2a8:3761:20:77:20ff:fe00:80learner@laptop:~$ dig lab.test NS +noall +answerlab.test.		300	IN	NS	ns.lab.test.learner@laptop:~$ 

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, networking lab (netlab 1.1), GNU Bash 5.2.21. Follow the alias and read which server holds the zone.
Steps (6)
  1. Type dig www.lab.test AAAA +noall +answer
  2. Press Enter
  3. Output: www.lab.test. 300 IN CNAME web.lab.test. web.lab.test. 300 IN AAAA fd85:b2a8:3761:20:77:20ff:fe00:80
  4. Type dig lab.test NS +noall +answer
  5. Press Enter
  6. Output: lab.test. 300 IN NS ns.lab.test.
  • Read a name from the root down toward the most specific label.
  • Ask for the type that matches the fact you need.
  • Compare the data and type when one name has several records.

Next, Resolvers and authoritative servers follows the question across the lab.