Skip to content

Resolvers and authoritative servers

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

You asked dns for the web address from laptop. The zone lives on ns. Which machine answered? Watch the messages at dns, then ask both servers yourself to find out what each one does.

Keep DNS mode on as in Names, zones, and records. Leave machine shells and run netlab reset on the VM. For the capture, give the lab a clean start before making any lookup. Open two VM terminals so you can leave the listener running while making the request.

On laptop, run cat /etc/resolv.conf. The nameserver line names 10.77.20.53, the address of dns. The search lab.test line lets programs that use the search setting try that ending on a short name. Keep typing complete names for these tests.

Read the lookup settings
learner@laptop:~$ cat /etc/resolv.confnameserver 10.77.20.53
search lab.testlearner@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 client settings point to 10.77.20.53 for lookups.
Steps (3)
  1. Type cat /etc/resolv.conf
  2. Press Enter
  3. Output: nameserver 10.77.20.53 search lab.test

A resolver finds DNS answers for a client. The client on laptop sends this lookup to the resolver in its settings. You can read its address before sending a single packet.

In the first VM terminal enter netlab shell dns. Run sudo tcpdump -n -i eth0 port 53. Use your Ubuntu password when prompted. The filter keeps traffic with source or destination port 53. In the second terminal enter netlab shell laptop and run the lookup in the second card. Then return to the listener and press Ctrl+C.

Predict. How many messages does laptop send for one lookup? How many does dns send?

Watch a lookup at dns
learner@dns:~$ sudo tcpdump -n -i eth0 port 53[sudo] password for learner: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes13:45:55.660250 IP 10.77.10.10.43011 > 10.77.20.53.53: 56196+ [1au] A? web.lab.test. (53)
13:45:55.660382 IP 10.77.20.53.52791 > 10.77.20.54.53: 27889+ [1au] A? web.lab.test. (53)
13:45:55.660505 IP 10.77.20.54.53 > 10.77.20.53.52791: 27889*- 1/1/1 A 10.77.20.80 (90)
13:45:55.660593 IP 10.77.20.53.53 > 10.77.10.10.43011: 56196* 1/1/1 A 10.77.20.80 (90)^C4 packets captured
4 packets received by filter
0 packets dropped by kernellearner@dns:~$ 

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 listener shows both sides of the lookup, from the client's question to the final answer.
Steps (10)
  1. Type sudo tcpdump -n -i eth0 port 53
  2. Press Enter
  3. Output: [sudo] password for learner:
  4. Type the password (the terminal shows nothing)
  5. Press Enter
  6. Output: tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
  7. In the second terminal on laptop, run the lookup. Then return here and stop the listener.
  8. Output: 13:45:55.660250 IP 10.77.10.10.43011 > 10.77.20.53.53: 56196+ [1au] A? web.lab.test. (53) 13:45:55.660382 IP 10.77.20.53.52791 > 10.77.20.54.53: 27889+ [1au] A? web.lab.test. (53) 13:45:55.660505 IP 10.77.20.54.53 > 10.77.20.53.52791: 27889*- 1/1/1 A 10.77.20.80 (90) 13:45:55.660593 IP 10.77.20.53.53 > 10.77.10.10.43011: 56196* 1/1/1 A 10.77.20.80 (90)
  9. Press Ctrl + C
  10. Output: 4 packets captured 4 packets received by filter 0 packets dropped by kernel
Ask for the address on laptop
learner@laptop:~$ dig web.lab.test +noall +answerweb.lab.test.		300	IN	A	10.77.20.80learner@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 client asks one question and prints the returned IPv4 record.
Steps (3)
  1. Type dig web.lab.test +noall +answer
  2. Press Enter
  3. Output: web.lab.test. 300 IN A 10.77.20.80

One lookup through dns

  1. laptop10.77.10.10
  2. dns10.77.20.53
  3. ns10.77.20.54
  1. Question: web.lab.test A: laptop to dns Captured at laptop:eth0.
  2. Question: web.lab.test A: dns to ns Captured at dns:eth0.
  3. Answer: 10.77.20.80: ns to dns Captured at dns:eth0.
  4. Answer: 10.77.20.80: dns to laptop Captured at laptop:eth0.

In the capture4 messages at laptop:eth0 and dns:eth0

  1. 1. Question: web.lab.test A Captured at laptop:eth0.13:45:55.660205 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 95: 10.77.10.10.43011 > 10.77.20.53.53: 56196+ [1au] A? web.lab.test. (53)
  2. 2. Question: web.lab.test A Captured at dns:eth0.13:45:55.660382 02:77:20:00:00:53 > 02:77:20:00:00:54, ethertype IPv4 (0x0800), length 95: 10.77.20.53.52791 > 10.77.20.54.53: 27889+ [1au] A? web.lab.test. (53)
  3. 3. Answer: 10.77.20.80 Captured at dns:eth0.13:45:55.660506 02:77:20:00:00:54 > 02:77:20:00:00:53, ethertype IPv4 (0x0800), length 132: 10.77.20.54.53 > 10.77.20.53.52791: 27889*- 1/1/1 A 10.77.20.80 (90)
  4. 4. Answer: 10.77.20.80 Captured at laptop:eth0.13:45:55.660612 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 132: 10.77.20.53.53 > 10.77.10.10.43011: 56196* 1/1/1 A 10.77.20.80 (90)

Step-by-step model built from captured frames · Frames captured at laptop:eth0 and dns:eth0 while running dig web.lab.test +noall +answer, on Ubuntu 24.04.5 LTS, netlab 1.1, tcpdump 4.99.4. The values are the capture's. Step-by-step model built from captured frames from the same lookup.Machines by IP address; captured at laptop:eth0 and dns:eth0. Routers on the path are not drawn.
Steps (4)

Machines by IP address; captured at laptop:eth0 and dns:eth0. Routers on the path are not drawn.

  1. Question: web.lab.test A. laptop to dns. Captured at laptop:eth0. The client asks the server in its settings.13:45:55.660205 02:77:10:00:00:10 > 02:77:10:00:00:01, ethertype IPv4 (0x0800), length 95: 10.77.10.10.43011 > 10.77.20.53.53: 56196+ [1au] A? web.lab.test. (53)
  2. Question: web.lab.test A. dns to ns. Captured at dns:eth0. The resolver asks the server that holds the zone.13:45:55.660382 02:77:20:00:00:53 > 02:77:20:00:00:54, ethertype IPv4 (0x0800), length 95: 10.77.20.53.52791 > 10.77.20.54.53: 27889+ [1au] A? web.lab.test. (53)
  3. Answer: 10.77.20.80. ns to dns. Captured at dns:eth0. The zone server returns the record to the resolver.13:45:55.660506 02:77:20:00:00:54 > 02:77:20:00:00:53, ethertype IPv4 (0x0800), length 132: 10.77.20.54.53 > 10.77.20.53.52791: 27889*- 1/1/1 A 10.77.20.80 (90)
  4. Answer: 10.77.20.80. dns to laptop. Captured at laptop:eth0. The resolver returns the record to the client.13:45:55.660612 02:77:10:00:00:01 > 02:77:10:00:00:10, ethertype IPv4 (0x0800), length 132: 10.77.20.53.53 > 10.77.10.10.43011: 56196* 1/1/1 A 10.77.20.80 (90)
Check your answer

The client on laptop sends one message. The resolver dns sends two. It asks ns a question and sends the answer back to laptop.

Message From To What it carries
First laptop dns Question for web.lab.test A
Second dns ns Same question
Third ns dns Answer with 10.77.20.80
Fourth dns laptop Answer with 10.77.20.80

Match the two question lines by name and type. Then follow the answers back. The listener on dns can see both conversations because both use its interface.

An authoritative server answers from the records of a zone it holds. The server ns holds lab.test, so it is authoritative for that zone. The resolver dns holds no zone of its own in this lab. It asked ns for the record and passed the answer on. The reply to laptop came from dns. The record in it came from ns.

The lab uses one level. Its resolver already knows where to send questions for the lab zone. Public DNS has a hierarchy of servers. In the model, laptop asks once for the address of www.example.com. The resolver starts at the root. It follows NS records to the com servers and then to the example.com servers. Those servers supply the example address. The resolver returns it to the client.

A delegation tells the resolver which servers to ask for a part of the hierarchy below the current zone. The two replies marked NS carry those directions. This model leaves out stored answers and the paths the packets take.

An Internet name lookup In this simplified model, laptop asks the resolver once. The resolver asks the root servers, then the com servers, then the example.com servers. The first two reply with NS records that name the next servers to ask. The example.com servers reply with the address 192.0.2.10, which the resolver returns to laptop. Simplified model laptop Resolver 0 Ask once 7 Address Root servers 1 Where is www.example.com? 2 Ask com servers (NS) com servers 3 Where is www.example.com? 4 Ask example.com servers (NS) example.com servers 5 Where is www.example.com? 6 Address: 192.0.2.10
An Internet name lookup In this simplified model, laptop asks the resolver once. The resolver asks the root servers, then the com servers, then the example.com servers. The first two reply with NS records that name the next servers to ask. The example.com servers reply with the address 192.0.2.10, which the resolver returns to laptop. Simplified model laptop Resolver 0 Ask once 7 Address Root servers 1 www.example.com? 2 Next servers (NS) com servers 3 www.example.com? 4 Next servers (NS) example.com servers 5 www.example.com? 6 192.0.2.10
Simplified model. The client asks once. The resolver follows NS records from the root to the servers for example.com.

From laptop, ask 10.77.20.54 for the web address. Then ask 10.77.20.53 the same question. Use @ with the server’s address in both commands. Compare the type and data first.

Ask ns and dns the same question
learner@laptop:~$ dig @10.77.20.54 web.lab.test +noall +answerweb.lab.test.		300	IN	A	10.77.20.80learner@laptop:~$ dig @10.77.20.53 web.lab.test +noall +answerweb.lab.test.		300	IN	A	10.77.20.80learner@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. Both servers return the same A record and address for web.
Steps (6)
  1. Type dig @10.77.20.54 web.lab.test +noall +answer
  2. Press Enter
  3. Output: web.lab.test. 300 IN A 10.77.20.80
  4. Type dig @10.77.20.53 web.lab.test +noall +answer
  5. Press Enter
  6. Output: web.lab.test. 300 IN A 10.77.20.80

The record and data match, so dns gave a faithful copy of what ns holds. Only the server you asked changed, as shown by the @ address.

“My computer asks the website’s server for its address.” Read the first message. Its destination is dns. The web address appears later in the answer.

“The resolver knows every name.” The second message shows where dns went for this answer.

In the listener, A? marks a question for an IPv4 address. The answer line shows the A record’s address. Each lookup can use a different client port. Compare the two lookups in Caching and TTLs to see that number change while the server port stays at 53.

Operating DHCP and DNS covers running these servers.

Ask each server for the text attached to lab.test from laptop. Choose the type. Keep the name and type the same, and change only the server. Write down whether the two answers agree and which server holds the record.

Solution

Use TXT. Both answers give the same text. The zone copy from the previous lesson identifies ns as the server that holds it.

Compare two answers about the zone
learner@laptop:~$ dig @10.77.20.54 lab.test TXT +noall +answerlab.test.		300	IN	TXT	"RootVolt networking lab"learner@laptop:~$ dig @10.77.20.53 lab.test TXT +noall +answerlab.test.		300	IN	TXT	"RootVolt networking lab"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 lab text first from ns and then from dns.
Steps (6)
  1. Type dig @10.77.20.54 lab.test TXT +noall +answer
  2. Press Enter
  3. Output: lab.test. 300 IN TXT "RootVolt networking lab"
  4. Type dig @10.77.20.53 lab.test TXT +noall +answer
  5. Press Enter
  6. Output: lab.test. 300 IN TXT "RootVolt networking lab"
  • The client sends the question to the resolver in its settings.
  • The resolver finds the answer and returns it.
  • An authoritative server holds the zone. NS records can guide a resolver to it.

Next, Caching and TTLs shows what happens when dns already has an answer.