---
title: "Quiz: DNS: How Names Become Addresses"
domain: networking
level: beginner
questions: 10
---

# Quiz: DNS: How Names Become Addresses

## Questions

### 1. A busy company resolver answers thousands of queries a minute for many different domains, yet it almost never sends a query to a root server. Why?
*Objective: 1. Explain the DNS hierarchy and how a name is resolved.*

- A) Root servers only answer queries from TLD operators, so resolvers must skip them.
- B) The stub resolvers on the laptops contact the root servers directly instead.
- C) The referrals to the TLD servers are cached with long TTLs, so the resolver goes straight to the TLD or domain servers it already knows.
- D) Root servers push the full contents of every zone to resolvers once a day.

### 2. At 09:58 a user looks up `newhost.example.com` and gets `NXDOMAIN`. At 10:00 an administrator creates the record. The `example.com` SOA record has a TTL of 3600 and a minimum field of 900. At the latest, when will the user's resolver return the new record?
*Objective: 1. Explain the DNS hierarchy and how a name is resolved.*

- A) At about 10:13, when the negative answer, cached for 900 seconds, expires.
- B) Immediately, because `NXDOMAIN` answers are never cached.
- C) At about 10:58, after the SOA record's 3600-second TTL.
- D) Only after someone increases the SOA serial on the resolver.

### 3. `dig example.com MX +noall +answer` returns the two records below. Which server should a sending mail server try first?
*Objective: 2. Identify the common record types and what each is used for.*

```text
example.com.		3600	IN	MX	20 mx2.example.org.
example.com.		3600	IN	MX	10 mx1.example.com.
```

- A) `mx2.example.org`, because it is listed first in the answer.
- B) `mx1.example.com`, because the lowest preference value is tried first.
- C) `mx2.example.org`, because a higher preference value means more preferred.
- D) Either one at random, because MX records have no order.

### 4. An administrator wants `dig -x 192.0.2.25` to return `mail.example.com.`. What must exist, and where?
*Objective: 2. Identify the common record types and what each is used for.*

- A) An A record for `mail.example.com` in the `example.com` zone; reverse lookups read it backwards automatically.
- B) A CNAME from `192.0.2.25` to `mail.example.com` in the `example.com` zone.
- C) A PTR record at `192.0.2.25.in-addr.arpa`, published by the domain's registrar.
- D) A PTR record at `25.2.0.192.in-addr.arpa`, in the reverse zone controlled by whoever holds the address block (or delegated by them).

### 5. What does this output tell you about `www.example.com`?
*Objective: 3. Query DNS with `dig` and interpret the sections and response flags.*

```text
$ dig www.example.com AAAA
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2210
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
...
;; AUTHORITY SECTION:
example.com.		300	IN	SOA	ns1.example.com. hostmaster.example.com. 2026110601 7200 900 1209600 300
```

- A) The name `www.example.com` doesn't exist at all.
- B) The name exists but has no AAAA record; the SOA lets the resolver cache that negative answer.
- C) The resolver couldn't reach the authoritative servers, so it returned the SOA instead.
- D) The answer was truncated and must be repeated with `+tcp`.

### 6. Ten minutes ago you changed `web.example.com` from `192.0.2.10` to `192.0.2.20` and raised the serial. You run two commands. What explains the difference?
*Objective: 3. Query DNS with `dig` and interpret the sections and response flags.*

```text
$ dig @198.51.100.10 web.example.com +norec +noall +answer
web.example.com.	3600	IN	A	192.0.2.20
$ dig @203.0.113.53 web.example.com +noall +answer
web.example.com.	2950	IN	A	192.0.2.10
```

`198.51.100.10` is `ns1.example.com`; `203.0.113.53` is the company resolver.

- A) The zone change didn't load, so the serial must be raised again.
- B) `ns1.example.com` is a lame server that isn't authoritative for `example.com`.
- C) The resolver is answering from its cache; the old record expires there in about 2950 seconds.
- D) The resolver's answer is the authoritative one, because it has the lower TTL.

### 7. After a firewall change, most lookups still work, but this one fails. What is the most likely cause?
*Objective: 4. Compare DNS transports: UDP and TCP on port 53, DoT (853) and DoH (443).*

```text
$ dig @203.0.113.53 example.com DNSKEY +dnssec
;; Truncated, retrying in TCP mode.
;; communications error to 203.0.113.53#53: timed out
```

- A) The new rules allow UDP 53 but block TCP 53, so answers too large for a UDP message can't be fetched.
- B) The resolver doesn't support EDNS(0), so it can't answer DNSSEC queries.
- C) Port 853 is blocked, and DNSSEC answers are always sent over DNS over TLS.
- D) DNSKEY records can only be fetched over DNS over HTTPS.

### 8. Which statement about DNS over TLS (DoT) and DNS over HTTPS (DoH) is correct?
*Objective: 4. Compare DNS transports: UDP and TCP on port 53, DoT (853) and DoH (443).*

- A) DoT encrypts the whole path from the client to the authoritative server, while DoH protects only the first hop.
- B) DoT uses TCP port 443 and DoH uses UDP port 853.
- C) Both validate DNSSEC signatures, so a network that uses them doesn't need DNSSEC.
- D) DoT uses its own port, 853, which makes it easy to recognize and block; DoH uses port 443 and is hard to tell apart from other web traffic.

### 9. An off-path attacker tries to poison a resolver that doesn't validate DNSSEC, by triggering lookups of many random names under `example.com` and racing forged responses against the real ones. Which resolver behaviour makes the forged responses hardest to match?
*Objective: 5. Assess DNS threats and explain what DNSSEC protects and what it doesn't.*

- A) Sending every query from the same fixed source port, so firewall rules stay simple.
- B) Keeping the zone's records cached for longer TTLs.
- C) Randomizing the UDP source port of every query, in addition to the 16-bit message ID.
- D) Answering recursive queries from anyone on the Internet.

### 10. A colleague says: "Since we signed our zone and our resolvers validate DNSSEC, nobody on a hotel Wi-Fi can see which of our sites our staff look up." What is the best response?
*Objective: 5. Assess DNS threats and explain what DNSSEC protects and what it doesn't.*

- A) Correct: DNSSEC encrypts queries between the stub resolver and the recursive resolver.
- B) Incorrect: DNSSEC signs data for authenticity and integrity but doesn't encrypt it; queries stay readable on the path unless they are sent over DoT or DoH.
- C) Correct, but only for zones whose DS record is published in the parent zone.
- D) Incorrect: DNSSEC only protects zone transfers between primary and secondary servers.

---

## Answer key

<details>
<summary>Show answers</summary>

| # | Answer | Explanation |
|---|---|---|
| 1 | C | Root referrals (the NS records of each TLD) carry TTLs of days, so after the first lookup the resolver already knows the `com`, `org`… servers and often the domain's own servers. Root servers answer anyone (A), and stubs never walk the tree themselves (B). |
| 2 | A | Negative answers are cached (RFC 2308) for the smaller of the SOA record's TTL and its minimum field: min(3600, 900) = 900 seconds, so until about 10:13. NXDOMAIN is cached (B), and resolvers have no serial of their own to change (D). |
| 3 | B | MX preference is "lower is better": `mx1.example.com` (10) is tried first and `mx2.example.org` (20) is the backup. The order in which records appear in an answer carries no meaning (A). |
| 4 | D | Reverse lookups ask for a PTR record under `in-addr.arpa`, with the address octets reversed. That zone belongs to the holder of the address block (the ISP or hosting provider, which may delegate it), not to the registrar of `example.com` (C), and A records are never read backwards (A). |
| 5 | B | `NOERROR` with zero answers is NODATA: the name exists but has no record of this type. `NXDOMAIN` would mean the name doesn't exist (A); a resolver that can't reach the servers returns `SERVFAIL` (C); truncation shows the `tc` flag (D). |
| 6 | C | The authoritative server already serves the new address (full TTL, asked with `+norec`). The resolver's TTL of 2950 shows a cached copy counting down from 3600; it will fetch the new record when that expires. A lower TTL means an older cached copy, not more authority (D). |
| 7 | A | `Truncated, retrying in TCP mode` means the UDP answer had the `tc` flag; the retry over TCP 53 then times out, which points to blocked TCP. Small answers fit in UDP, so they still work. RFC 7766 requires TCP support; DNSSEC doesn't depend on port 853 (C). |
| 8 | D | DoT (RFC 7858) has a dedicated port, 853; DoH (RFC 8484) rides on HTTPS port 443. Both protect only the client-to-resolver hop, not the resolver's queries to authoritative servers (A), and neither replaces DNSSEC's signatures (C). |
| 9 | C | A forged response must match the query's message ID and destination port. Randomizing the source port (RFC 5452) adds roughly 16 bits of guessing to the 16-bit ID. Long TTLs (B) don't help, because each random name is a fresh lookup; that is exactly what the Kaminsky technique exploits. Open recursion (D) makes the resolver easier to abuse. |
| 10 | B | DNSSEC provides data origin authentication and integrity: forged answers fail validation. It provides no confidentiality: names and answers still travel in the clear over UDP or TCP 53. Encrypting the query path is the job of DoT or DoH. |

</details>
