1. LPU MCA Semester 1
  2. CAP7001
  3. Unit 6

CAP7001 · Unit 6: Application layer

DNS and DHCP

10 practice questions · in the ETE syllabus

Key points

  • DNS uses port 53 and a root, TLD, authoritative hierarchy
  • A is IPv4, AAAA is IPv6, MX is mail, PTR is reverse
  • Recursive means the server returns the final answer
  • DHCP steps are Discover, Offer, Request, Acknowledge
  • Relay agents carry DHCP across routers; T1 is 50 percent of the lease

DNS maps host names to IP addresses using a hierarchy of root servers, top-level domain (TLD) servers and authoritative servers. It uses port 53, UDP for ordinary queries and TCP for large replies and zone transfers.

Common records: A (IPv4 address), AAAA (IPv6 address), MX (mail server), NS (name server), CNAME (alias) and PTR (address to name). Answers are cached for their TTL, so a changed record spreads only as old caches expire.

In a recursive query the contacted server does all the work and returns the final answer. In an iterative query it returns the best referral and the asker continues. For www.example.com with an empty cache, a resolver queries the root, then the .com server, then the example.com server: three servers.

DHCP leases an IP address plus settings such as mask, gateway and DNS server. Servers use UDP port 67 and clients 68. The exchange is DORA: Discover, Offer, Request, Acknowledge. The client renews at T1 = 50 percent of the lease (4 hours of an 8-hour lease) and rebinds at T2 = 87.5 percent. Because broadcasts stop at routers, a relay agent forwards requests to a server on another subnet. A host that gets no answer self-assigns a 169.254.x.x address.

Pool example: a /24 has 254 usable addresses; excluding 20 reserved ones and .254 leaves 233.

Exam trap: a recursive server may still query many servers; recursion describes the service to the client.

Try two questions

Question 1 · Tier 3, Apply

A DHCP lease lasts 8 hours. After how many hours from the lease start does the client first try to renew it, using the default T1 timer?

  1. 2
  2. 7
  3. 4
  4. 8
Show the answer

C. T1 is 50 percent of the lease, so 4 hours, and T2 is 87.5 percent, so 7 hours.

Why not A: That is 25 percent of the lease.

Why not B: That is the rebinding time T2 at 87.5 percent.

Why not D: That is the whole lease, when it expires.

Question 2 · Tier 4, Analyse

A resolver with an empty cache looks up www.example.com iteratively, asking a root server, then a TLD server, then the authoritative server. How many servers does the resolver query to get the address?

  1. 3
  2. 1
  3. 2
  4. 4
Show the answer

A. Root refers to the .com server, which refers to the example.com server, which answers.

Why not B: That counts only the authoritative server.

Why not C: That leaves out one level of the hierarchy.

Why not D: That adds the client itself as a fourth step.