乐闻世界logo
搜索文章和话题

What Are the Types of DNS Servers and Their Roles

3月6日 22:53

DNS servers can be classified into various types based on their functions and positions in the DNS resolution chain. Understanding these types is crucial for building a reliable DNS architecture.

DNS Server Classification

By Function

TypeFunctionExample
Recursive DNS ServerCompletes full query on behalf of client8.8.8.8, 1.1.1.1
Authoritative DNS ServerStores and manages domain datans1.example.com
Root ServerTop layer of DNS hierarchya.root-servers.net
TLD ServerManages top-level domains.com, .org servers
Forwarding DNS ServerForwards queries to other DNSEnterprise internal DNS

Recursive DNS Server

Definition and Role

Recursive DNS Server receives DNS queries from clients and is responsible for completing the entire query process, returning final results.

Workflow

shell
Client → Recursive DNS Server Recursive DNS Server queries root server Queries TLD server Queries authoritative DNS server Returns final IP to client

Characteristics

Client-friendly: Client only needs to send one request ✅ Caching: Caches query results, improves performance ✅ Simplifies Client: Client doesn't need to understand DNS hierarchy

High Server Load: Needs to complete all subsequent queries ❌ May Be Abused: Can be used for DNS amplification attacks

Configuration Example

bind
; named.conf options { recursion yes; allow-recursion { trusted; }; recursion-clients 1000; }; zone "." { type hint; file "root.hints"; };

Common Recursive DNS Servers

ProviderAddressFeatures
Google8.8.8.8Stable and reliable
Cloudflare1.1.1.1Privacy-first
Quad99.9.9.9Malicious domain blocking
Alibaba223.5.5.5Fast domestic access

Authoritative DNS Server

Definition and Role

Authoritative DNS Server stores and manages DNS data for specific domains, serving as the final data source for those domains.

Workflow

shell
Recursive DNS Server → Authoritative DNS Server Authoritative DNS Server queries local data Returns authoritative answer

Characteristics

Authoritative Data: Provides final data for domains ✅ Configurable: Administrators can configure DNS records ✅ Supports DNSSEC: Can sign DNS data

Non-recursive: Only answers domains it's responsible for ❌ No Caching of Other Domains: Only stores its own data

Configuration Example

bind
; Master server zone "example.com" { type master; file "/etc/bind/db.example.com"; allow-transfer { 192.0.2.10; }; }; ; Slave server zone "example.com" { type slave; file "/etc/bind/db.example.com.slave"; masters { 192.0.2.1; }; };

Master-Slave Architecture

shell
Master Server ↓ AXFR/IXFR Slave Server 1 Slave Server 2

Advantages:

  • High availability
  • Load distribution
  • Data redundancy

Root Server

Definition and Role

Root Server is the highest layer of DNS hierarchy, knowing the locations of all top-level domain (TLD) servers.

Workflow

shell
Recursive DNS Server → Root Server Root Server returns TLD server address Recursive DNS Server queries TLD server

Characteristics

DNS Starting Point: Starting point for all DNS resolution ✅ Anycast Deployment: Multiple nodes globally ✅ Highly Stable: Distributed architecture

Limited Quantity: Logically only 13

Root Server List

IdentifierOperatorLocation
AVerisignUSA
BUSC-ISIUSA
CCogentUSA
DUniversity of MarylandUSA
ENASAUSA
FISCUSA
GUS DoD NICUSA
HUS Army Research LabUSA
INetnodSweden
JVerisignUSA
KRIPE NCCUK/Netherlands
LICANNUSA
MWIDE ProjectJapan

TLD Server

Definition and Role

TLD Server (Top-Level Domain Server) manages DNS data for top-level domains (like .com, .org, .cn).

Workflow

shell
Recursive DNS Server → TLD Server TLD Server returns authoritative DNS server address Recursive DNS Server queries authoritative DNS server

Common TLDs

TLDManagement OrganizationFeatures
.comVerisignLargest TLD
.orgPublic Interest RegistryNon-profit organizations
.netVerisignNetwork services
.cnCNNICChina's national domain

Forwarding DNS Server

Definition and Role

Forwarding DNS Server forwards client DNS queries to other DNS servers instead of resolving them itself.

Workflow

shell
Client → Forwarding DNS Server Forwards to upstream DNS server Upstream DNS server returns results Forwarding DNS Server returns to client

Configuration Example

bind
; named.conf options { forward only; forwarders { 8.8.8.8; 1.1.1.1; }; };

Use Cases

  • Enterprise Internal: Unified use of upstream DNS
  • Firewall Restrictions: Limit direct internet access
  • Cache Optimization: Local caching of upstream DNS results

DNS Server Architecture Design

Typical Architecture

shell
Users Local DNS (Recursive) ┌────┴────┐ ↓ ↓ Root Server Forwarding DNS ↓ ↓ TLD Server Upstream DNS ↓ ↓ Authoritative DNS Server

High Availability Architecture

shell
Users Local DNS Cluster (Load Balanced) ┌────┴────┐ ↓ ↓ Master Slave Authoritative Authoritative ↓ ↓ Database Database

Common Interview Questions

Q: What's the difference between recursive DNS server and authoritative DNS server?

A:

  • Recursive DNS Server: Completes full query on behalf of client, returns final result (e.g., 8.8.8.8)
  • Authoritative DNS Server: Stores and manages DNS data for specific domains, provides authoritative answers (e.g., ns1.example.com)

Q: Why do we need master-slave DNS servers?

A:

  1. High Availability: When master server fails, slave servers continue serving
  2. Load Distribution: Multiple servers share query load
  3. Data Redundancy: Prevent data loss

Q: What's the role of forwarding DNS server?

A:

  1. Unified Management: Enterprise internal unified use of upstream DNS
  2. Security Control: Limit direct internet access
  3. Performance Optimization: Local caching of upstream DNS results

Q: What's the difference between root server and TLD server?

A:

  • Root Server: Top layer of DNS hierarchy, knows locations of all TLDs
  • TLD Server: Manages specific top-level domains (e.g., .com), knows authoritative servers for all domains under that TLD

Summary

TypeRoleCharacteristics
Recursive DNSQuery on behalf of clientCaching, simplifies client
Authoritative DNSStore domain dataAuthoritative, configurable
Root ServerDNS starting pointAnycast, stable
TLD ServerManage top-level domainsHierarchical management
Forwarding DNSForward queriesUnified management, caching

标签:DNS