# Domain Name System (DNS) Architecture & Deployment **Notes:** Learn the basics of the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), and how a DNS zone maps domain names to IP addresses. **Recommended reading** - [Unix Networking](/2026/course/406-unix-networking/) --- ## What is the Domain Name System?  --- ### Domain name system  **Notes:** The [**Domain Name System (DNS)**](https://en.wikipedia.org/wiki/Domain_Name_System) is a hierarchical decentralized naming system for computers connected to the Internet or a private network. Most prominently, it **translates human-readable domain names** (like `google.com`) **to numerical IP addresses** (like `172.217.21.238`) needed for locating computers with the underlying network protocols. The Domain Name System has been an essential component of the functionality of the Internet since 1985. --- ### DNS hierarchy
Root
.
Top-level domains
ch
com
org
Second-level domains
heig-vd
.ch
example
.com
microsoft
.com
wikipedia
.org
Third-level domains
www
.heig-vd.ch
www
.microsoft.com
fr
.wikipedia.org
[ICANN](https://en.wikipedia.org/wiki/ICANN) manages [top-level domains (TLDs)](https://en.wikipedia.org/wiki/Top-level_domain). **Notes:** The DNS is a tree of names. At its top is the **root**. Its name is empty, and is written as a single dot. Under the root are the **top-level domains (TLDs)**, such as `ch`, `com` and `org`. [ICANN](https://en.wikipedia.org/wiki/ICANN) manages the root, and delegates each top-level domain to an organization that runs it, for example SWITCH for `ch` and Verisign for `com`. Under each top-level domain are **second-level domains**, such as `microsoft.com`. They are delegated in turn to the organizations or people who bought them. The manager of a second-level domain can create **third-level domains** under it, such as `www.microsoft.com`, and so on. A domain name is read from right to left, from the root down: `www.microsoft.com` is `www`, under `microsoft`, under `com`, under the root. The rest of a name is always its parent: `www.microsoft.com` is under `microsoft.com`, and has nothing to do with `www.heig-vd.ch`. Since 2012, an organization can apply to run a [generic top-level domain](https://en.wikipedia.org/wiki/Generic_top-level_domain) of its own. The application fee alone was $185,000 that year. --- ### DNS zone
Root
.
Top-level domains
ch
com
org
Second-level domains
heig-vd
.ch
example
.com
microsoft
.com
wikipedia
.org
Third-level domains
www
.heig-vd.ch
www
.microsoft.com
fr
.wikipedia.org
**Notes:** A [DNS zone](https://en.wikipedia.org/wiki/DNS_zone) is a subset of the domain name space for which administrative responsibility has been delegated to a single manager. For example, Microsoft has purchased the rights to manage the `microsoft.com` domain and all its subdomains from the manager of the `.com` [top-level domain (TLD)](https://en.wikipedia.org/wiki/Top-level_domain). Once they have those rights, they can create any number of subdomains for their business needs. You can also purchase a domain name as an individual, giving you the right to manage that portion of the DNS hierarchy. --- ### DNS zone file
Name
TTL
Class
Type
Data
@
10800
IN
A
203.0.113.10
@
10800
IN
MX
10 mail.example.com.
www
10800
IN
CNAME
example.com.
jde
1800
IN
A
203.0.113.42
Resource record
: one line of the zone file
Name
:
jde.example.com
TTL
: time to live, in seconds
Class
: Internet
Type
: Address (IPv4)
Data
: the IPv4 address
**Notes:** The manager of a DNS zone describes it in a [zone file](https://en.wikipedia.org/wiki/Zone_file), with one line per **resource record**. This is part of the zone of `example.com`. The first three records are the kind a domain often has: an IPv4 address for `example.com` itself, the server that receives its mail (`MX`), and `www` as an alias of `example.com` (`CNAME`). The last record adds a subdomain. Its fields are: - **Name**: a name in a zone file is relative to the zone's domain, so `jde` in the zone of `example.com` means `jde.example.com`. The name `@` means the domain itself, `example.com`. - **TTL**: the record's _time to live_. Whoever receives this answer may keep it in a cache for up to 1800 seconds (30 minutes), and answer from that cache instead of asking again. - **Class**: `IN` stands for Internet. It is the only class you will meet. - **Type**: `A` stands for Address. An `A` record maps a name to an IPv4 address. - **Data**: what the record maps the name to. Its form depends on the type: for an `A` record, it is an IPv4 address, here `203.0.113.42`. --- ### Mapping names to addresses
Name
TTL
Class
Type
Data
@
10800
IN
A
203.0.113.10
jde
1800
IN
A
203.0.113.42
*.jde
1800
IN
A
203.0.113.42
example.com
→
203.0.113.10
jde.example.com
→
203.0.113.42
foo.jde.example.com
→
203.0.113.42
bar.jde.example.com
→
203.0.113.42
**Notes:** Each record maps one name to an address: `@` maps `example.com` itself, and `jde` maps `jde.example.com`. The name `*.jde` is a **wildcard**: it maps any name under `jde.example.com` that has no record of its own, such as `foo.jde.example.com` or `bar.jde.example.com`, without having to add a record for each one. A wildcard does not match the name it is under: `*.jde` does not map `jde.example.com` itself. That is why it takes two records, `jde` and `*.jde`, for both `jde.example.com` and every name under it to reach the same server. [dns]: https://en.wikipedia.org/wiki/Domain_Name_System [dns-zone]: https://en.wikipedia.org/wiki/DNS_zone [dns-zone-file]: https://en.wikipedia.org/wiki/Zone_file [gtld]: https://en.wikipedia.org/wiki/Generic_top-level_domain [icann]: https://en.wikipedia.org/wiki/ICANN [tld]: https://en.wikipedia.org/wiki/Top-level_domain
GitHub