📝 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.
📝 All DNS in computer networks MCQs
Q1. What does the acronym DNS stand for?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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.
📖 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.
📖 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.
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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.
📖 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?
📖 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.