Skip to content
Tech Interview Prep
Technical interview guide

DNS & DHCP

How devices get an IP address automatically, and how domain names get resolved into one.

Read
45 min
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed
Relevant for
Network Engineer

Scope: Current IETF DNS, negative caching, DNSSEC, DNS over TCP/TLS/HTTPS, DHCPv4/options/relay, DHCPv6, SLAAC, and mDNS references reviewed 2026-09-04.

Curated: · Written: · Reviewed:

25 questions

MCQ-1A stub resolver on a laptop asks its configured recursive resolver for `api.example.com`. The recursive resolver has never seen this name, and its cache is empty. It queries a root server, which returns a referral to the `.com` TLD servers; it queries a `.com` server, which returns a referral to `example.com`'s authoritative servers; it queries one of those, which returns the A record with TTL 300. The laptop then asks for `api.example.com` again 40 seconds later. What does the recursive resolver do on that second query?
MCQ-2ns1.example.com is authoritative for example.com. Its zone file contains a delegation: sub.example.com NS ns1.sub.example.com, but no records for host.sub.example.com. A recursive resolver sends ns1 a query for host.sub.example.com. What does ns1 return?
MCQ-3A resolver with an empty cache is asked for www.shop.example.com. It walks root → .com → example.com, and the example.com servers return a referral to shop.example.com whose NS records are ns1.shop.example.com and ns2.shop.example.com, with no A or AAAA records for either name. Both nameservers are up and answering on 203.0.113.10 and 203.0.113.11. What does the resolver do next?
MCQ-4A team is moving api.example.com from 203.0.113.10 to 198.51.100.20 at 14:00. The A record's TTL is 86400. At 13:00 they lower the TTL to 60, and at 14:00 they change the record to the new address. Clients use standard OS stub resolvers with no application-level DNS cache. Hours after 14:00, a meaningful share of requests still reach the old IP. What explains this?
MCQ-5example.com's zone carries this SOA record: ``` example.com. 3600 IN SOA ns1.example.com. hostmaster.example.com. 2024010101 7200 3600 1209600 300 ``` At 09:58 a resolver queries `api.example.com`, which does not exist yet, and gets NXDOMAIN. At 10:00 the team creates the A record for `api.example.com`. The resolver honors the SOA-derived negative TTL and has nothing else cached. When does it first return the new A record?
MCQ-6A team runs `example.com` on a managed DNS provider. They want `www.example.com` to point at `shop.example.net`, and they also want to publish a TXT record at `www.example.com` for domain verification. They create a CNAME at `www.example.com` with target `shop.example.net`, then add the TXT record at the same name. The provider's API accepts both writes and returns 200 for each. What happens when a resolver queries `www.example.com` for TXT?
MCQ-16A zone's SOA on the primary reads serial 2024011501, refresh 3600, retry 600, expire 604800, minimum 300. At 10:00 an operator changes www's A record from 203.0.113.10 to 203.0.113.20 but leaves the serial at 2024011501. The secondary polls the primary every hour and every poll succeeds. What does the secondary return for www at 14:00?
MCQ-9A resolver sends a query for a name whose authoritative server returns a 3 KB response. The resolver's UDP receive buffer is 1232 bytes, and the response arrives with the TC bit set. The resolver's TCP connection to that server then times out after 2 seconds. What is the correct behavior for the resolver to report to the client?
MCQ-8A client resolves `shop.example.com` through a DoH-enabled public resolver. An attacker on the path between that resolver and the zone's authoritative servers forges an A record, and the client accepts it. The zone publishes no DNSSEC records. Which statement explains why DoH did not prevent this?
MCQ-7A zone's RRSIGs are valid for 14 days and the zone is re-signed every 7 days. The signer fails at T=0; the last successful signing run was at T=-2 days. No further signing occurs. At what time do validating resolvers first return SERVFAIL for the zone?
MCQ-10A team maintains split-horizon DNS for `corp.example`: the internal view resolves `db.corp.example` to 10.20.4.7 and `vpn.corp.example` to 192.168.30.9, and the public view serves only `www.corp.example`. To save time, an engineer copies the internal zone file onto the public authoritative servers and deletes the records they can remember. What is the primary risk of this arrangement?
MCQ-21A BIND 9.18 server hosts `corp.example` with this policy: ``` update-policy { grant dhcp-key subdomain dhcp.corp.example A DHCID; }; ``` The ISC DHCP 4.4 server holds the `dhcp-key` TSIG secret, is configured with `ddns-domainname "corp.example"`, and hands out leases in 10.20.0.0/16. When host `ws-1042` takes a lease, the DHCP log shows: `Forward map from ws-1042.corp.example to 10.20.14.7 FAILED: REFUSED` What is the cause?
MCQ-12A client obtained a 3600-second lease from server B at t=0; the DHCPACK carried no T1 or T2 options. At t=1800 a capture shows one DHCPREQUEST sent unicast to B's address with no server identifier option, and B replies with DHCPACK. What is the client doing?
MCQ-14A DHCP client holds a lease with these parameters: lease time 7200 s, T1 = 3600 s, T2 = 6300 s. At t = 3600 s the client unicasts a DHCPREQUEST to the server that allocated the lease. The server is up and reachable but its DHCP service has been stopped, so the request gets no reply. The client keeps retransmitting to that same server and receives nothing. What does the client do next, and when?
MCQ-22A DHCPv4 client holds a 3600-second lease. Its unicast renewal at T1 gets no DHCPACK. What does the client do at T2, and what happens if the lease then expires with still no server response?
MCQ-25A DHCP scope hands out DNS server option 6. The lease time is 2 h. At 10:00 you change option 6 from 10.0.0.52 to 10.0.0.53. A validation test renews a lease on a test client at 10:05 and confirms it now uses 10.0.0.53, so the change is marked successful. At 10:30, monitoring shows 40% of clients on that subnet still send DNS queries to 10.0.0.52. What is the most likely reason?
MCQ-13A DHCP server at 10.0.0.5 serves three subnets. Clients on 10.30.0.0/24 have no local server; the router interface 10.30.0.1 is configured as a relay, which inserts giaddr = 10.30.0.1 into the client's DISCOVER. The server has selected 10.30.0.50 for the client. Where does the server send the OFFER?
MCQ-15In an enterprise network architecture with centralized DHCP servers and routed access switches acting as relay agents, what mechanism does DHCP Option 82 (Relay Agent Information Option) provide?
MCQ-11An access switch runs DHCP snooping with the uplink to the distribution pair trusted and every user port untrusted. A user connects a laptop running a DHCP server, and on another user port a script floods DISCOVERs with random source MACs. Which two behaviors of the switch stop each attack?
MCQ-18A 400-host office VLAN runs one legitimate DHCP server at 10.0.0.10 with a 12-hour lease. At 09:14 a helpdesk ticket wave reports that roughly 60 laptops which were working at 08:00 now have addresses in 192.168.50.0/24, a gateway of 192.168.50.1, and DNS 192.168.50.1; those laptops can reach 192.168.50.1 but cannot reach the 10.0.0.0/8 file servers they used an hour earlier. The legitimate server's logs show no DISCOVER for those MAC addresses in that window. What is the most likely explanation?
MCQ-17A branch office runs one DHCP server for subnet `10.20.0.0/24`. The scope's range is `10.20.0.100`–`10.20.0.199` with a 12-hour lease, and the rest of the /24 is unused. The site has 140 workstations and 30 VoIP phones, all powered on from 08:00 to 18:00; by mid-morning new devices log `no free leases`. The lease file shows every active lease was renewed within the last 12 hours. Which action addresses the root cause of the recurring exhaustion rather than relieving today's symptom?
MCQ-24At 14:00 a Kea DHCP server's lease file is corrupted and the newest usable backup is from 08:00. The subnet is 192.168.10.0/24, leases last 8 hours, and T1 is 4 hours. What should the server do before it resumes allocating addresses?
MCQ-20A host brings up an interface and forms the link-local address fe80::21a:2bff:fe3c:4d5e with EUI-64. Before the address is usable, the host sends two Neighbor Solicitations for the solicited-node multicast address ff02::1:ff3c:4d5e and gets no Neighbor Advertisement back. It then sends a Router Solicitation and receives a Router Advertisement. What is the state of fe80::21a:2bff:fe3c:4d5e at this point?
MCQ-19A host on a new segment receives one Router Advertisement: source fe80::1, Router Lifetime 0, M=0, O=0, and a single Prefix Information option for 2001:db8:1:1::/64 with A=1 and L=1. No other configuration source is present. What does the host's IPv6 routing table contain after processing it?
MCQ-23A host on a segment receives a Router Advertisement with M=0 and O=1 and an advertised prefix whose A flag is set. What configuration does it end up with?