🎓 BookMCQ
← Back to 26. Standard Client Server Protocols

📝 DNS in computer networks (17 MCQs)

DNS as the Internet's Distributed Naming Service

The Domain Name System (DNS) is a distributed, hierarchical naming system that stores records about domain names and associated network services. Applications use DNS to obtain information such as host addresses and mail exchangers instead of requiring users to remember numerical IP addresses. DNS operates at the application layer and is essential to many Internet services. Its distributed structure avoids reliance on one central database for every Internet name worldwide.

Resolvers, Name Servers and Resource Records

A stub resolver on a host sends queries to a recursive resolver, which can consult authoritative name servers. Zones contain resource records such as A, AAAA, NS and MX. A resolver interprets the query name and type, follows referrals when necessary, and returns an answer or an error according to the DNS response.

Turning a Domain Name into Network Information

An application requests a name lookup, and the host resolver checks available local information before querying a configured DNS resolver. The recursive resolver uses cached data or queries authoritative servers through the hierarchy. The answer is returned to the client, which can then use the resulting address to open an application connection.

Resolving a Web Server Name

A browser needs the IPv4 address for www.example.net. Its resolver asks for an A record. A recursive resolver checks its cache; if no usable answer exists, it finds the appropriate authoritative server and obtains the record. The address is returned to the browser, which can then connect to the web server.

DNS over UDP and TCP in IP Networks

DNS commonly uses UDP port 53 for ordinary queries and can use TCP port 53 when needed, including zone transfers and responses that require TCP handling. DNS does not itself establish a web connection or route IP packets. It supplies naming data that applications and network stacks use when selecting destinations.

Misunderstandings About DNS Operation

'DNS converts every URL into a web page' is incorrect because DNS resolves domain names to record data, not page content. 'All DNS messages use UDP only' ignores TCP use. 'A DNS server is always authoritative' is false because recursive resolvers and authoritative name servers perform different roles in the resolution process.

Tracing DNS Lookups and Record Answers

Identify the stub resolver, recursive resolver and authoritative server in a lookup diagram. Distinguish A from AAAA, NS and MX records, and state that port 53 can use UDP or TCP. Trace how a cached or authoritative response supplies data used by an application, without attributing HTTP retrieval or packet routing to DNS.

DNS Naming and Resolution Terms

  • DNS - Stores records for domain names.
  • Stub resolver - Sends queries to a DNS resolver.
  • Recursive resolver - Obtains final answers for clients.
  • Authoritative server - Provides data for its DNS zone.
  • Resource record - Stores typed DNS data.
  • A record - Maps a name to IPv4.
5
Easy
8
Medium
4
Hard

📝 All DNS in computer networks MCQs

Q1. What does the acronym DNS stand for?

A.Domain Name System ✅
B.Dynamic Network Service
C.Distributed Naming Scheme
D.Digital Node System
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The acronym DNS expands to Domain Name System, which is the hierarchical, distributed database that translates human‑readable domain names into IP addresses used by networking protocols. Understanding this definition is fundamental because all subsequent DNS operations rely on this name‑to‑address mapping mechanism.

Q2. Which port number is used by DNS for standard queries over UDP?

A.80
B.53 ✅
C.443
D.25
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: DNS queries over UDP normally use port 53. This well‑known port allows client resolvers to send lightweight query packets to recursive or authoritative servers. Recognizing the correct port is essential for configuring firewalls and troubleshooting network connectivity issues related to DNS traffic.

Q3. A resolver receives a DNS response with a TTL of 3600 seconds. After 1800 seconds the resolver caches the record. What remaining TTL will be sent in subsequent responses?

A.3600 seconds
B.5400 seconds
C.1800 seconds ✅
D.0 seconds
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: TTL (Time‑to‑Live) counts down as time passes. When the record is cached for 1800 seconds, the remaining TTL is the original 3600 minus the elapsed 1800, leaving 1800 seconds. The resolver includes this reduced TTL in any later responses, ensuring downstream caches respect the remaining lifetime.

Q4. If a parent zone lacks NS records for a delegated child zone, what is the most likely effect on DNS resolution for names within that child zone?

A.Queries are redirected to root servers
B.Resolution fails with SERVFAIL ✅
C.Resolver falls back to recursive mode
D.Cached answers are used indefinitely
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: When a parent zone does not contain NS records for a delegated child, resolvers cannot locate the child’s authoritative servers. Consequently, the resolution process aborts with a SERVFAIL error, indicating that the server could not retrieve the necessary data to answer the query.

Q5. A client receives an unsigned DNS response but the DNSSEC‑enabled resolver expects a valid RRSIG. What inference can be made about the response?

A.The response failed DNSSEC validation
B.The response is authoritative
C.The response is cached
D.The response will be forwarded unchanged ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: DNSSEC requires each signed RRSet to carry an RRSIG. If a response lacks this signature, the resolver treats the data as insecure and, because validation is mandatory, it marks the response as failed DNSSEC validation, typically resulting in a SERVFAIL to the client.

Q6. A DNS zone contains a CNAME record that points to another CNAME, which eventually points back to the original name. What will a resolver do when encountering this loop?

A.It will abort with a CNAME loop error
B.It will follow the chain indefinitely ✅
C.It will treat the last CNAME as an A record
D.It will return a NXDOMAIN response
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: When a resolver detects that following CNAME records would create a cycle, it stops processing to avoid infinite recursion. The standard response is to abort the lookup and return a CNAME loop error, signaling that the configuration is invalid.

Q7. Disabling recursion on a DNS server will cause which of the following behaviors for external clients?

A.Clients receive faster responses
B.The server will forward queries to upstream servers
C.The server will cache all answers
D.Clients can only query data that the server is authoritative for ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: Recursion disabled means the server will not pursue queries beyond its own authority. External clients therefore receive answers only for zones for which the server is authoritative; any other name results in a referral or error, preventing the server from acting as a full resolver.

Q8. Compare iterative and recursive DNS queries in terms of client workload and network traffic.

A.Iterative queries reduce client workload but increase traffic
B.Recursive queries shift workload to the client
C.Iterative queries require the client to follow referrals while recursive queries hide the process ✅
D.Both query types behave identically
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: In an iterative query the client receives referrals and must issue additional queries itself, increasing client processing but reducing server load. A recursive query hides this complexity: the server performs all lookups and returns the final answer, simplifying the client’s task at the cost of more server‑side traffic.

Q9. Evaluate the advantages of DNS over HTTPS (DoH) compared to traditional DNS regarding privacy and performance.

A.DoH encrypts queries, reducing eavesdropping, but may add latency
B.DoH eliminates the need for caching
C.DoH guarantees faster resolution than UDP
D.DoH removes the need for root servers ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: DoH encapsulates DNS queries inside HTTPS, providing encryption that prevents passive observers from seeing the domain names being looked up. While this improves privacy, the additional TLS handshake and HTTP overhead can introduce latency, making performance a trade‑off compared with plain UDP DNS.

Q10. Differentiate between an authoritative DNS server and a caching resolver in terms of data freshness and query handling.

A.Authoritative servers store zone data and provide definitive answers; caching resolvers store recent answers temporarily
B.Authoritative servers only cache ✅
C.Caching resolvers are always more up‑to‑date than authoritative servers
D.Both serve identical roles
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Authoritative servers hold the master copy of zone records and answer queries with guaranteed freshness. Caching resolvers, on the other hand, temporarily store responses they receive from authoritative servers, improving response speed but potentially serving slightly stale data until the cached TTL expires.

Q11. Which statement best contrasts forward DNS lookup with reverse DNS lookup?

A.Forward lookup uses UDP while reverse uses TCP
B.Forward lookup maps domain names to IP addresses; reverse lookup maps IP addresses to domain names ✅
C.Reverse lookup requires DNSSEC
D.Both lookups use the same record types
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: A forward lookup translates a human‑readable domain name into its corresponding IP address using A or AAAA records. Conversely, a reverse lookup starts with an IP address and resolves it to a domain name via PTR records in the in‑addr.arpa or ip6.arpa zones, performing the opposite mapping.

Q12. An organization implements rate limiting on its DNS server to mitigate amplification attacks. Which side effect is most likely?

A.Legitimate high‑volume clients may experience delayed responses
B.Attack traffic is completely blocked
C.DNSSEC validation stops working ✅
D.TTL values are reduced automatically
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Rate limiting caps the number of responses a server can send to a particular client within a time window. While this thwarts large‑scale amplification, legitimate clients that legitimately send many queries may encounter increased latency or occasional drops, affecting normal service quality.

Q13. Why is setting an appropriate TTL value important for load‑balancing across multiple web servers?

A.Short TTLs allow traffic to shift quickly when a server is added or removed
B.Longer TTLs improve security ✅
C.TTL does not affect load balancing
D.TTL determines IP address format
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: A short TTL forces caches to expire records quickly, enabling traffic to be redistributed to newly added or removed servers without waiting for stale entries. This rapid turnover is crucial for dynamic load‑balancing environments where server availability changes frequently.

Q14. A multinational corporation needs DNS zones for each region while maintaining a single corporate brand. Which design best satisfies scalability and administrative delegation?

A.Use a flat zone with all records in one file
B.Publish all records in a single public zone without delegation
C.Assign each region a separate top‑level domain
D.Create a hierarchical zone structure with sub‑zones per region, delegating authority to regional admins ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: A hierarchical zone tree lets the corporation keep a global parent zone (e.g., corp.com) and delegate sub‑zones such as eu.corp.com or apac.corp.com to regional teams. This approach scales well, isolates administrative responsibilities, and preserves a unified brand while allowing region‑specific records.

Q15. Given the HTTP GET example in the provided content, how does DNS resolution affect the client’s ability to retrieve /usr/bin/image1?

A.DNS provides the IP address of the server hosting the image, enabling the TCP connection
B.DNS encrypts the image data
C.DNS determines the MIME type ✅
D.DNS sets the HTTP status code
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Before the client can send the GET request, it must resolve the host name to an IP address via DNS. The obtained IP allows the TCP three‑way handshake to succeed, after which the HTTP GET for /usr/bin/image1 can be transmitted. Without DNS, the client would lack the destination address.

Q16. Explain why TTL values influence the effectiveness of DNS caching for frequently accessed websites.

A.Longer TTLs improve security
B.Shorter TTLs cause caches to refresh more often, ensuring up‑to‑date data
C.TTL does not affect caching
D.TTL only matters for IPv6 ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: When a TTL is short, cached records expire quickly, prompting resolvers to query authoritative servers more often. This frequent refresh keeps data current, which is valuable for sites that change IPs or load‑balance often. Conversely, long TTLs reduce query traffic but may serve outdated information for longer periods.

Q17. If a client repeatedly requests the same domain within a short interval, how does DNS caching improve overall latency?

A.The resolver can answer from its cache without contacting authoritative servers, reducing round‑trip time
B.The client bypasses the network stack
C.The DNS protocol switches to TCP automatically ✅
D.The request is ignored
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: When a resolver has a recent answer cached, it can respond instantly without performing additional network lookups. This eliminates the need for extra round‑trip times to authoritative servers, dramatically lowering latency for repeated queries and reducing overall network load.

🔗 Related Topics (MCQs)