Home » DNS Deep Dive: DNSSEC, DoH, DoT, Split-Horizon และ DNS Security
DNS Deep Dive: DNSSEC, DoH, DoT, Split-Horizon และ DNS Security
DNS Deep Dive: DNSSEC, DoH, DoT, Split-Horizon และ DNS Security
DNS (Domain Name System) เป็น critical infrastructure ที่แปลง domain names เป็น IP addresses DNSSEC เพิ่ม cryptographic signatures เพื่อ validate DNS responses, DoH (DNS over HTTPS) และ DoT (DNS over TLS) encrypt DNS queries เพื่อ privacy, Split-Horizon DNS ให้คำตอบต่างกันตาม source network และ DNS Security ป้องกัน attacks เช่น cache poisoning, DNS tunneling และ DDoS
DNS เป็น protocol ที่ ถูก attack บ่อยที่สุด เพราะ traditional DNS ใช้ UDP plaintext (ไม่ encrypt, ไม่ authenticate) ทำให้ถูก sniff, spoof, redirect ได้ง่าย DNSSEC ป้องกัน spoofing, DoH/DoT ป้องกัน eavesdropping และ DNS security best practices ป้องกัน amplification attacks + data exfiltration
DNS Resolution Process
Step
Action
Server
1. Client Query
Client ถาม “www.example.com คือ IP อะไร?”
→ Recursive Resolver
2. Root Query
Resolver ถาม Root server “ใคร handle .com?”
→ Root Server (13 clusters)
3. TLD Query
Resolver ถาม .com TLD “ใคร handle example.com?”
→ TLD Server
4. Authoritative Query
Resolver ถาม authoritative NS “IP ของ www.example.com?”
→ Authoritative NS
5. Response
Authoritative NS ตอบ IP address
→ Resolver → Client
6. Caching
Resolver cache คำตอบตาม TTL
ไม่ต้อง query ซ้ำจนกว่า TTL หมด
DNS Record Types
Record
Purpose
Example
A
Domain → IPv4 address
www.example.com → 93.184.216.34
AAAA
Domain → IPv6 address
www.example.com → 2606:2800:220:1:…
CNAME
Domain alias → another domain
blog.example.com → example.wordpress.com
MX
Mail server สำหรับ domain
example.com → mail.example.com (priority 10)
TXT
Text records (SPF, DKIM, verification)
v=spf1 include:_spf.google.com ~all
NS
Authoritative nameservers
example.com → ns1.example.com, ns2.example.com
SOA
Zone authority info (serial, refresh, retry)
Primary NS, admin email, serial number
SRV
Service location (host + port)
_sip._tcp.example.com → sipserver.example.com:5060
PTR
IP → Domain (reverse DNS)
34.216.184.93.in-addr.arpa → www.example.com
DNSSEC
Feature
รายละเอียด
คืออะไร
DNS Security Extensions — เพิ่ม digital signatures ให้ DNS records
Problem Solved
ป้องกัน DNS spoofing/cache poisoning (ตรวจสอบว่า response มาจาก authoritative source จริง)
RRSIG
Digital signature ของ DNS record set
DNSKEY
Public key ที่ใช้ verify RRSIG
DS (Delegation Signer)
Hash ของ child zone’s DNSKEY → stored in parent zone (chain of trust)
NSEC/NSEC3
Prove ว่า domain ไม่มีอยู่จริง (authenticated denial of existence)
Chain of Trust
Root → TLD → Authoritative (verify จาก root ลงมา)
Limitation
ไม่ encrypt DNS data (แค่ authenticate) → ต้องใช้ DoH/DoT สำหรับ privacy
DoH and DoT
Feature
DoH (DNS over HTTPS)
DoT (DNS over TLS)
Port
443 (same as HTTPS)
853 (dedicated port)
Encryption
TLS 1.2/1.3 (via HTTPS)
TLS 1.2/1.3 (direct)
Protocol
HTTP/2 with DNS wire format or JSON
TLS wrapper around DNS
Blocking
ยากมาก (port 443 = same as web traffic)
ง่ายกว่า (block port 853)
Enterprise Control
ยากกว่า (bypass corporate DNS easily)
ง่ายกว่า (block port 853 + redirect)
Privacy
ดีมาก (hidden in HTTPS traffic)
ดี (encrypted but identifiable port)
Providers
Cloudflare (1.1.1.1), Google (8.8.8.8), Quad9
Same providers
Split-Horizon DNS
Feature
รายละเอียด
คืออะไร
DNS server ตอบคำตอบต่างกันตาม source IP/network ของ client
Internal View
Internal clients → ได้ private IPs (10.0.0.x, 192.168.x.x)
External View
External clients → ได้ public IPs
Use Case
app.company.com: internal = 10.0.1.100, external = 203.0.113.50
Implementation
BIND views, Windows DNS policies, cloud DNS routing policies
Benefit
Internal traffic stays internal (ไม่ hairpin ผ่าน firewall)
DNS Attacks and Defense
Attack
วิธีการ
Defense
Cache Poisoning
Inject fake records into resolver cache
DNSSEC (validate signatures)
DNS Amplification DDoS
Spoof source IP + send query → large response to victim
Response Rate Limiting (RRL), BCP38
DNS Tunneling
Encode data in DNS queries (data exfiltration)
DNS monitoring, query analysis, block unusual patterns
Domain Hijacking
Change NS records at registrar
Registry lock, MFA on registrar account
NXDOMAIN Attack
Query random non-existent domains (overwhelm resolver)
NXDOMAIN rate limiting, caching negative responses
Typosquatting
Register similar domain (gogle.com)
DMARC, user awareness, brand monitoring
DNS Best Practices
Practice
รายละเอียด
Enable DNSSEC
Sign zones + validate on resolvers (prevent spoofing)
Use DoH/DoT
Encrypt DNS queries (privacy + prevent manipulation)
Redundant DNS
Minimum 2 NS (different networks/providers) → high availability
Low TTL for critical
Critical records: TTL 300-600s (fast failover), stable records: TTL 3600+
Monitor DNS
Monitor query volume, NXDOMAIN rate, unusual patterns
Response Rate Limiting
Limit identical responses per second (prevent amplification)
Registry Lock
Lock domain at registry level (prevent unauthorized NS changes)
ทิ้งท้าย: DNS = Critical Infrastructure, Must Secure
DNS Deep Dive DNSSEC: cryptographic signatures → authenticate DNS responses (prevent spoofing) DoH: encrypted DNS over HTTPS (port 443, hard to block, best privacy) DoT: encrypted DNS over TLS (port 853, easier to manage in enterprise) Split-Horizon: different answers for internal vs external clients Attacks: cache poisoning, amplification DDoS, tunneling, hijacking Defense: DNSSEC + DoH/DoT + RRL + monitoring + registry lock + redundant NS
อ่านเพิ่มเติมเกี่ยวกับ Network Security Firewall NGFW และ VPN Technologies IPsec WireGuard ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com