Fundamentals 7 min read

Understanding DNS: Structure, Records, and Query Types Explained

This article provides a comprehensive overview of the Domain Name System (DNS), covering its hierarchical structure, authority delegation, zones, common resource record types, and the three main query methods—recursive, iterative, and reverse—along with step‑by‑step resolution examples.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Understanding DNS: Structure, Records, and Query Types Explained

DNS (Domain Name System) translates IP addresses to hostnames and vice versa, acting as a massive distributed database that stores mappings and other information for domains.

DNS Structure

DNS uses a hierarchical, tree‑like naming scheme. The top of the tree is the root (represented by a dot .), followed by top‑level domains (TLDs), then second‑level domains, and any number of sub‑domains separated by dots.

Two categories of TLDs: generic TLDs (gTLD) such as .com, .org, .edu, .net; and country‑code TLDs (ccTLD) like .cn, .in, .uk, .ru.

Authority, Delegation, and Zones

The root zone and gTLD zones are overseen by ICANN. ccTLDs are managed by individual countries. Each level can delegate authority to the next lower level, and each level runs its own DNS servers responsible for the zones they control.

A zone contains the DNS data for a portion of the domain tree. For example, the example.com zone holds records for example.com itself, while sub‑domains like a.example.com may have separate zones if delegated.

Resource Records

Zones are composed of resource records (RRs) that provide specific information about objects. Common record types include:

A record: Maps a hostname to its IPv4 address.

PTR record: Maps an IP address to a hostname (reverse lookup).

NS record: Indicates the authoritative name servers for a domain.

MX record: Specifies mail exchange servers for a domain.

DNS Query Types

Three main query types exist:

Recursive query – the DNS server must return the final answer, contacting other servers as needed.

Iterative query – the DNS server returns the best answer it has, possibly a referral to another server.

Reverse query – given an IP address, the server returns the associated hostname.

Recursive Query Walkthrough

The client asks its configured DNS server for the IP of a.example.com.

The local server checks its cache; not found.

It queries a root server for the address of a.example.com.

The root server replies with the address of the .com TLD server.

The DNS server queries the .com TLD server, which refers it to the authoritative server for example.com.

The server queries the example.com authoritative server, which returns the A record for a.example.com.

The original DNS server returns this A record to the client.

Iterative queries follow a similar path but return referrals at each step, while reverse queries start with an IP address and look up the corresponding PTR record.

Link: https://bbs.huaweicloud.com/blogs/371116
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DNSDomain Name SystemInternet fundamentalsQuery TypesResource Records
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.