Common Types of DNS Queries, Servers and Records Explained

by

Last Updated:
5 min read
Common Types of DNS Queries, Servers and Records Explained

Key Takeaways

  • The Domain Name System (DNS) translates human-readable domain names into IP addresses, enabling browsers and devices to locate online services.
  • DNS query resolution relies on recursive and iterative queries, where recursive resolvers navigate the DNS hierarchy to retrieve records on behalf of the client.
  • In authoritative DNS, all nameservers listed in a domain’s NS records actively handle incoming queries simultaneously; secondaries synchronize data via zone transfers (AXFR/IXFR) rather than sitting as idle backups.
  • Forwarding DNS resolvers route queries to designated upstream resolvers rather than resolving them recursively down the root hierarchy itself.
  • DNS records follow strict structural rules: A/AAAA records map domain names to IP addresses, CNAME records alias names to a canonical target (and cannot exist at the zone apex), and MX records specify mail servers by priority and must not target CNAME aliases.

DNS, or the Domain Name System, is a service that translates domain names into IP addresses. This is how your browser knows how to find the website you’re looking for when you type in a URL.

To understand how DNS functions across the internet, it helps to distinguish between two fundamental concepts: DNS Query Types (how clients and resolvers communicate) and DNS Server Roles (how different servers store records, forward requests, or cache data).

When your device or an application looks up an address, DNS resolution involves specific query mechanisms:

1. Recursive DNS Query

In a recursive query, the client (such as your operating system’s stub resolver) asks a recursive resolver to fully resolve the domain name. The resolver takes on the entire burden of finding the answer, querying other servers across the internet until it retrieves the final IP address and returns it to your device.

2. Non-Recursive DNS Query

According to RFC 9499, a non-recursive query is defined as a query with the Recursion Desired (RD) bit set to 0. In non-recursive mode, the queried nameserver does not pursue the query further on the client’s behalf; per RFC 1034 Section 4.3.1, it immediately returns an answer (if it holds authoritative data or has the record cached), an error, or a referral to nameservers lower in the hierarchy.

Iterative queries are themselves non-recursive queries. In iterative resolution, the recursive resolver issues a succession of non-recursive (RD=0) queries down the DNS hierarchy, following referrals from root servers to TLD servers until it reaches an authoritative nameserver for the target domain.

Common DNS Server Types Explained

1. Primary DNS server

The primary DNS server (master server) is the authoritative nameserver that holds the original, editable master copy of a domain’s zone file. Any changes to your domain’s DNS records—such as updating an IP address or adding an authentication record—are made directly on the primary server.

2. Secondary DNS server

A secondary DNS server (slave server) is an authoritative nameserver that obtains an identical, read-only copy of the zone file from the primary server through an automated process known as a zone transfer (AXFR under RFC 5936, or incremental IXFR under RFC 1995, notified via RFC 1996).

Contrary to a common misconception, a secondary DNS server is not an idle backup that only activates when the primary server fails. All nameservers listed in a domain’s NS records are active simultaneously. Resolvers typically prefer nameservers that have responded faster in the past (based on measured round-trip time statistics, as described in RFC 1034 Section 5.3.3 and RFC 2182). Secondary servers provide active load distribution and geographic redundancy, and can be hosted on third-party infrastructure, independent cloud networks, or dedicated nameservers.

3. Tertiary DNS server

In authoritative DNS architecture, there is no official concept known as a “tertiary DNS server.” Authoritative configurations rely entirely on primary and secondary relationships (with domains often using multiple secondary servers for added redundancy).

The term “tertiary DNS” typically only appears in client-side operating system or router network adapter settings. In these settings, you may see fields for “Preferred,” “Alternate,” and occasionally “Tertiary” DNS servers. These fields represent a list of external recursive resolvers that your local device will typically fall back through sequentially if the first resolver fails to respond.

4. Forwarding DNS Resolver

A forwarding DNS server (or forwarder) is a resolver configured to send incoming queries to another designated upstream resolver instead of performing the full recursive resolution process itself (RFC 9499).

DNS forwarding is commonly used in enterprise and private networks. It allows administrators to route internal domain queries to local servers while forwarding all external internet queries through a central, secured gateway. This setup centralizes outbound DNS traffic, improves network efficiency, and simplifies the enforcement of security policies and content filtering.

5. Caching-Only DNS Server

A caching-only DNS server is a recursive resolver that does not host any authoritative zones of its own. Its sole purpose is to process recursive lookups for local network clients, store the responses in its local memory cache based on the record’s Time to Live (TTL), and answer future identical queries immediately from cache.

This type of DNS server accelerates browsing performance on local networks by eliminating repetitive lookups over the internet. While network-wide domain filtering (such as DNS Response Policy Zones or blocklists) can be implemented on caching resolvers to block malicious domains, filtering is an administrative capability rather than a feature unique to caching-only servers.

Common DNS Record Types Explained

Some of the more common DNS types include:

1. A Records

A Records (Address records) are used to map a domain name or hostname to a 32-bit IPv4 address (RFC 1035). For modern IPv6 networks, the equivalent record is the AAAA record, which maps a hostname to a 128-bit IPv6 address (RFC 3596). These records are fundamental for connecting client devices to web servers, mail servers, and API endpoints.

2. CNAME Records

CNAME Records (Canonical Name records) make one domain name an alias of another canonical domain name (RFC 1034). This allows multiple hostnames (such as www.example.com or blog.example.com) to point to a single canonical name (like example.com), ensuring that if the canonical target’s IP address changes, all aliases update automatically.

Importantly, under RFC 2181 Section 10.1, a CNAME record cannot coexist with any other record other than DNSSEC records (such as RRSIG and NSEC) for the same hostname. Because a domain’s root or zone apex (e.g., example.com) requires mandatory SOA and NS records, a CNAME cannot be placed at the zone apex.

3. MX Records

MX Records (Mail Exchanger records) direct inbound email messages to the mail servers responsible for handling mail for a domain. Each MX record specifies a mail server hostname and a preference (priority) value. Sending mail servers attempt delivery to the server with the lowest preference number first, falling back to higher numbers if that server is unavailable.

Under RFC 2181 Section 10.3, the host name specified in an MX record must point directly to an address record (A or AAAA) and must never point to a CNAME alias.

DNS is incredibly important because it’s what allows us to access websites and other online services from our computers or phones without having to remember all their IP addresses every time we want to access them (which can be difficult if you have multiple devices). If something goes wrong with DNS, though, then it can mean trouble accessing those sites—or even worse!

DNS types