---
title: "Short note: DNS"
subject: "Computer Networks and Security"
chapter: 6
key: "semester_7/computer_networks_and_security:dns-note"
source: https://www.bctengineer.com/q/semester_7/computer_networks_and_security/dns-note
site: BCT Engineering
---

# Short note: DNS

Computer Networks and Security · Chapter 6: Application Layer

- Asked in: 2073 Chaitra, 4 marks; 2072 Chaitra, 4 marks (asked 2 times)
- Video: [Lec-81: Domain Name System (DNS) in computer Networks](https://www.youtube.com/watch?v=vhfRArT11jc) — Gate Smashers
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/computer_networks_and_security/dns-note
- Whole chapter: https://www.bctengineer.com/md/semester_7/computer_networks_and_security/chapter-6

## Question

Write a short note on DNS (Domain Name Server).

## Short answer

DNS is a distributed hierarchical database translating domain names to IP addresses, using port 53 (UDP/TCP). Hierarchy: root, TLD, authoritative, and local resolver servers. Key records: A (IPv4), AAAA (IPv6), NS (name server), CNAME (alias), MX (mail server), PTR (reverse), SOA (zone info). Resolvers query iteratively, caching results per TTL.

## Answer

**DNS (Domain Name System)** is a distributed hierarchical database that translates human-readable domain names (www.tu.edu.np) into IP addresses (and the reverse). It runs on port 53, normally on UDP (TCP for zone transfers and large replies). The server software is called a name server.

#### Hierarchy
```text
              . (root)
        /       |       \
      com      org      np  (TLD)
                       /  \
                    edu    com
                    /
                   tu   -> www.tu.edu.np
```

#### Types of name servers
- **Root servers:** know the TLD servers (13 root server addresses, many anycast copies).
- **TLD servers:** .com, .org, .np ...
- **Authoritative servers:** hold the real records of a domain.
- **Local (resolver) server:** the ISP's server that the host queries; it caches answers.

#### Working
The host's resolver asks the local DNS server. If the answer is not cached, the local server queries the root, TLD and authoritative servers in turn and returns the IP address. Answers are cached for the time given by their TTL.

#### Main records
A (IPv4), AAAA (IPv6), NS (name server), CNAME (alias), MX (mail server), PTR (reverse lookup), SOA (zone info).

Services: host name translation, mail server lookup, load distribution, host aliasing.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does DNS do?
   A. Assigns IP addresses to hosts
   B. Translates domain names to IP addresses using a distributed hierarchical database
   C. Routes packets
   D. Encrypts email
   Answer: B. DNS maps names to IPs (and reverse). (Key point: DNS function)

2. Which server actually holds the real records of a domain?
   A. Root server
   B. TLD server
   C. Authoritative server
   D. Local resolver
   Answer: C. Authoritative servers hold the domain's records; root and TLD servers only point onward. (Key point: Server types)

3. How does the local DNS server reduce repeated queries?
   A. It stores answers in cache for the TTL
   B. It uses a larger packet
   C. It converts to TCP
   D. It forwards all queries to root
   Answer: A. Answers are cached for the time given by their TTL. (Key point: Caching)

## Related in other subjects

- [DNS and its working mechanism](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Adns-working) — Distributed System, chapter 2, asked 3×
- [Internet vs Intranet and DNS need](https://www.bctengineer.com/question.md?key=semester_8%2Finternet_and_intranet%3Ainternet-intranet-compare-dns) — Internet and Intranet, chapter 1
- [Need and services of DNS](https://www.bctengineer.com/question.md?key=semester_8%2Finternet_and_intranet%3Adns-need-services) — Internet and Intranet, chapter 3
