DNS란 무엇이며 네임서버는 어떻게 작동하는가?
도메인 네임 시스템의 계층적 주소 해석, 루트 서버, A/AAAA/MX/TXT 레코드 및 암호화된 DNS-over-HTTPS (DoH) 기술 해설.
Web Protocols & Security Architecture Research
DNS란 무엇이며 네임서버는 어떻게 작동하는가?
TL;DR — 핵심 엔지니어링 요약
- DNS는 사람이 기억하기 쉬운 도메인 이름을 라우팅 가능한 IP 주소(IPv4 및 IPv6)로 변환합니다.
- 주소 해석 순서: 재귀 리졸버 → 루트 서버 → TLD 서버 → 권한 있는 네임서버.
- 핵심 레코드: A (IPv4), AAAA (IPv6), CNAME, MX, TXT.
- 최신 DNS는 도청 방지를 위해 DoH (RFC 8484) 및 DoT를 통해 통신을 암호화합니다.
핵심 개념 및 아키텍처 구조
Recursive Resolver
ResolverThe server (often ISP or public like 1.1.1.1 / 8.8.8.8) that iteratively queries the DNS hierarchy on behalf of the client.
Root Nameservers
Infrastructure13 root server IP identities (managed by IANA/ICANN) at the pinnacle of the DNS hierarchy serving root zone hints.
TLD Nameserver
HierarchyMaintains delegations for specific domain extensions (.com, .org, .dev, .io) and points to authoritative nameservers.
Authoritative Nameserver
AuthorityThe final destination holding master zone files with definitive DNS records for a domain.
Time-to-Live (TTL)
Caching32-bit unsigned integer specifying seconds a record may be cached before re-querying authoritative sources.
DNSSEC
SecurityCryptographic authentication of DNS responses using asymmetric keys (KSK, ZSK) to eliminate spoofing.
DNS란 무엇이며 네임서버는 어떻게 작동하는가?의 동작 원리와 메커니즘
When a browser requests a domain, the local operating system stub resolver checks local memory and hosts files. If uncached, it dispatches a recursive query over UDP port 53. The recursive resolver systematically walks down the hierarchical tree: first querying a root nameserver for the TLD delegation, then querying the TLD nameserver for the authoritative delegation, and finally querying the authoritative server for the exact record.
Local Cache Check
Browser checks internal DNS cache, OS socket cache (e.g. systemd-resolved), and hosts file.
getaddrinfo("curious-techie.com", NULL, &hints, &res);Recursive Resolver Query
The OS dispatches a recursive query to configured resolvers (e.g., 1.1.1.1 or internal VPC resolver).
dig +trace curious-techie.comRoot Hints Query
Resolver contacts a Root Nameserver (.); receives referral NS records for the .com TLD.
;; Query: curious-techie.com A
;; Referral to: a.gtld-servers.net.TLD Nameserver Query
Resolver queries TLD nameserver for .com; receives authoritative NS records and glue records.
;; NS Delegation: ns1.curious-techie.com. (Glue: 198.51.100.53)Authoritative Record Retrieval
Resolver queries authoritative nameserver directly; receives authoritative A/AAAA record with TTL.
curious-techie.com. 300 IN A 198.51.100.1Response & Client Cache
Resolver caches the answer for 300 seconds and returns IP to browser; TCP handshake begins.
Connect to 198.51.100.1:443 -> SYN / SYN-ACKDNS란 무엇이며 네임서버는 어떻게 작동하는가?의 실무 구현 및 적용 방법
Querying DNS Records via dig Command
bash# Query IPv4 Address (A Record)
dig +noall +answer curious-techie.com A
# Query Mail Exchange (MX Record) with Priority
dig +noall +answer curious-techie.com MX
# Trace Complete Iterative Resolution Path
dig +trace curious-techie.com
# Inspect Authoritative SOA Serial and Timers
dig curious-techie.com SOA엔지니어링 상세 정보: The dig (Domain Information Grok) utility sends raw DNS query packets and displays flags, answer sections, and TTL counters.
Configuring BIND Zone File Syntax (RFC 1035)
zonefile$TTL 3600
@ IN SOA ns1.example.com. admin.example.com. (
2026100501 ; Serial YYYYMMDDNN
7200 ; Refresh (2h)
3600 ; Retry (1h)
1209600 ; Expire (2w)
300 ; Negative Cache TTL (5m)
)
; Nameservers
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
; Host Records
@ IN A 198.51.100.1
@ IN AAAA 2001:db8::1
www IN CNAME curious-techie.com.
; Email Verification
@ IN MX 10 mail.example.com.
@ IN TXT "v=spf1 include:_spf.example.com ~all"엔지니어링 상세 정보: Standard RFC zone syntax declaring Start of Authority (SOA), nameservers, IPv4/IPv6 address records, CNAME aliases, and SPF text records.
운영 환경에서 DNS란 무엇이며 네임서버는 어떻게 작동하는가?을 사용하는 이유와 구성
Cloudflare / AWS CloudFront routing users to nearest edge point-of-presence (PoP).
GeoDNS and Anycast BGP announce identical IP addresses from hundreds of locations; resolvers receive localized routes.
Migrating production traffic between Kubernetes clusters across cloud providers.
Lower DNS TTL to 60 seconds 48 hours prior to migration; adjust Weighted CNAME records to gradually shift percentages.
Preventing phishing domains from impersonating corporate transactional emails.
Publishing strict SPF, DKIM (public key TXT record), and DMARC (p=reject) policy records at domain apex.
DNS란 무엇이며 네임서버는 어떻게 작동하는가? 구현 시 자주 발생하는 실수와 오해
영향도: Violates RFC 1034 section 3.6.2; breaks MX, NS, and SOA records on apex domain.
권장 해결책: Use ALIAS / ANAME record virtualization or native Apex flattened routing provided by modern DNS providers.
영향도: Users stay routed to decommissioned backends for up to 24 hours due to aggressive downstream caching.
권장 해결책: Pre-lower TTL to 300 seconds at least 24 hours before planned infrastructure maintenance.
영향도: Secondary slave nameservers fail to detect zone changes; zone transfer is never initiated.
권장 해결책: Always increment the 10-digit SOA serial (format: YYYYMMDDNN) with every zone edit.
DNS란 무엇이며 네임서버는 어떻게 작동하는가?의 보안 영향 및 취약점 분석
DNS Cache Poisoning (Kaminsky Attack)
CWE-348 / Kaminsky Flaw취약점: Attacker injects forged answers into resolver cache before authoritative response arrives.
DNS Amplification DDoS
OWASP Top 10 Denial of Service취약점: Open resolvers amplify small spoofed UDP requests into massive response floods targeting victim IPs.
Subdomain Takeover
CWE-284 Improper Access Control취약점: Dangling CNAME record points to abandoned cloud storage bucket or decommissioned SaaS service.
DNS란 무엇이며 네임서버는 어떻게 작동하는가? 오류 진단 및 트러블슈팅 가이드
발생 증상 및 오류 징후: NXDOMAIN returned for valid domain in production
- Typo in authoritative zone file
- Registrar nameservers pointing to wrong NS records
- Negative caching in local resolver
발생 증상 및 오류 징후: SERVFAIL returned intermittently across global regions
- DNSSEC validation failure due to expired RRSIG key
- Authoritative nameservers timing out or firewall dropping UDP 53
- Zone transfer failure
발생 증상 및 오류 징후: DNS changes visible locally but not globally (Propagation Lag)
- Downstream public resolvers honoring prior high TTL cache duration
- Stale OS local resolver cache
DNS란 무엇이며 네임서버는 어떻게 작동하는가?에 대한 자주 묻는 질문
Q:What is the difference between an Authoritative and a Recursive DNS server?
Authoritative servers (e.g. Cloudflare, Route53, BIND) answer "Who owns this domain and what is their IP?". Recursive resolvers (e.g. 1.1.1.1, Google 8.8.8.8, ISP resolvers) answer the client request by iteratively walking the tree from root hints downward.
Q:Why can’t a CNAME record co-exist with other record types at the domain root?
Because the root apex (@) requires an SOA record and at least two NS records for zone validity, an RFC-compliant nameserver cannot bind a CNAME to the apex. Modern DNS hosts resolve this via proprietary ALIAS/ANAME record synthetic flattening.
Q:Does DNS use UDP or TCP port 53?
Standard queries use stateless UDP to avoid connection handshake round trips. If an answer exceeds the buffer size, the server sets the TC (Truncation) bit in the header, prompting the client to retry over TCP port 53.
추천 관련 개발자 도구
100% 브라우저 메모리 실행
용어사전
References & Primary Sources
Every source below directly substantiates technical statements and protocol behaviors explained in DNS란 무엇이며 네임서버는 어떻게 작동하는가?. Curious-Techie prioritizes official Internet standards (IETF RFCs, W3C Recommendations, WHATWG specifications) and established security bodies (OWASP, NIST). Zero sponsored or secondary links.
- [1]IETFPrimary SpecificationRFC 1034 • Section 3 & 4Verified Primary SourceTechnical Claim Supported:
Establishes the hierarchical distributed domain name space, authoritative name servers, root zone topology, and zone delegations.
Source URI: https://datatracker.ietf.org/doc/html/rfc1034 - [2]IETFPrimary SpecificationRFC 1035 • Section 3.2 (Resource Records)Verified Primary SourceTechnical Claim Supported:
Defines standard DNS Resource Record wire structures (A, CNAME, MX, NS, PTR, SOA) and port 53 UDP/TCP protocol formats.
Source URI: https://datatracker.ietf.org/doc/html/rfc1035 - [3]IETFPrimary SpecificationRFC 8484 • Section 3 & 4Verified Primary SourceTechnical Claim Supported:
Standardizes encrypted DNS query transmission inside HTTP/2 and HTTP/3 HTTPS streams to prevent ISP eavesdropping and on-path manipulation.
Source URI: https://datatracker.ietf.org/doc/html/rfc8484
관련 기술 생태계 및 다음 학습 단계
추천 관련 개발자 도구
관련 기술 아티클
관련 기술 질문
What Happens When a DNS TTL Expires?
Answer: When a DNS TTL expires, caching resolvers evict the record and must re-query the authoritative nameserver before responding to clients.
Can a CNAME Record Point to an IP Address?
Answer: No, RFC 1034 requires CNAME records to point exclusively to another domain name, never to raw IPv4 or IPv6 addresses.
Why Can't a CNAME Record Coexist With Other Records at the Zone Apex?
Answer: RFC 1034 requires that if a CNAME exists at a node, no other record data may exist there. Since a zone apex must have SOA and NS records, CNAME is prohibited.
개발자 표준 규격 및 레퍼런스
다음 학습 단계
DNS Resolution & Propagation Lab
Trace authoritative resolution from the root servers down to the zone file in the visual DNS workbench.