DNS 플러드

보안 및 위협
DNS 인프라를 과도한 쿼리로 압도하는 서비스 거부 공격입니다.
← 용어집으로 돌아가기

DNS 홍수 공격이란?

DNS 홍수는 DNS 서버(authoritative nameservers 또는 recursive resolvers)에 DNS 쿼리의 다량 볼륨을 전송하여 DNS 인프라를 압도적으로 공격하는 Distributed Denial of Service (DDoS)의 유형입니다. 이 목표는 DNS 서비스를 사용할 수 없게 만들고 도메인 네임을 해결하는 합법적인 사용자를 방지하는 것입니다.

DNS 홍수 공격의 영향

DNS 서버가 압도 될 때:

Normal operation:

User → DNS query → DNS server → Response → Website loads

During DNS flood:

User → DNS query → DNS server (overwhelmed, no response)

→ Website doesn't load (even though web server is fine)

감염 :

DNS 홍수 공격 유형

직접 DNS 쿼리 홍수

Attacker는 높은 볼륨에서 합법적 인 DNS 쿼리를 보냅니다.

Botnet → Millions of DNS queries → Target DNS server

Query examples:

example.com A

www.example.com A

random1.example.com A

random2.example.com A

...millions more...

특성:

DNS 증폭 공격

폭발성 재발적 해결사 공격 트래픽을 증폭:

1. Attacker sends small query to open resolver

2. Spoofs source IP as victim's IP

3. Resolver sends large response to victim

4. Attacker amplifies bandwidth 28-54x

예금:
Attacker sends: 60-byte query for TXT record (ANY query)

Resolver sends: 3000-byte response to victim

Amplification: 50x

NXDOMAIN 홍수

non-existent 도메인에 대 한 쿼리 캐싱을 우회:

Query: random-12345.example.com (doesn't exist)

Server must check authoritative zone every time

Cannot be cached (NXDOMAIN responses often have low TTL)

Consumes more server resources than cached responses

Phantom 도메인 공격

응답하지 않는 쿼리 합법적인 도메인:

Attacker: Queries resolver for slow/non-responsive domains

Resolver: Waits for timeout, consumes resources

Result: Resolver resource exhaustion

무작위 Subdomain 공격

캐시를 피하기 위해 무작위 하위 도메인을 쿼리:

Query: abc123random.example.com

Query: xyz789random.example.com

Query: def456random.example.com

Each is unique → cache miss → authoritative query

Overwhelms authoritative nameservers

공격 벡터 및 기술

Botnet-Driven 공격

Compromised devices:
  • IoT devices (cameras, routers)
  • Infected computers
  • Hacked servers

Distributed attack:

10,000 bots × 100 queries/sec = 1 million queries/sec

반사 공격

Attacker spoofs victim's IP

Sends queries to many open resolvers

Resolvers respond to victim with large answers

Victim receives amplified traffic

신청 층 홍수

Legitimate-looking queries

Difficult to distinguish from real traffic

May target specific resource-intensive query types

DNS 홍수 공격 탐지

Unusual 쿼리 볼륨

Normal baseline: 10,000 queries/second

During attack: 500,000+ queries/second

감시자 :
# Check query rate (BIND)

rndc status | grep "queries resulted"

# Analyze query logs

tail -f /var/log/named/queries.log | wc -l

높은 NXDOMAIN 비율

Normal: 5-10% NXDOMAIN responses

Attack: 50-90% NXDOMAIN responses (random subdomain flood)

근원 IP 배급

Legitimate: Diverse source IPs, geographic spread

Attack: Concentrated sources, unusual geographic patterns

Query 패턴

Legitimate: Repetitive queries (common domains cached)

Attack: Unique queries (random strings, no cache benefit)

응답 시간 축하

Normal: < 50ms response time

Under attack: > 1000ms or timeouts

DNS 홍수 공격을 마이그레이션

인프라 수준 방위

# # # # # Anycast DNS

여러 지리적 위치에 걸쳐 분산 트래픽:

Single IP address (e.g., 1.2.3.4) announced from multiple locations

Attack traffic automatically routed to nearest server

Load distributed across global network

Harder to overwhelm all locations simultaneously

혜택: 제공자: Cloudflare, AWS Route 53, NS1, Dyn

#### 대형 DNS 인프라

Capacity: 10x normal peak traffic

Reserves: Handle sudden spikes

Auto-scaling: Add capacity during attacks

#### 비율 제한

# BIND rate limiting (response-rate limiting)

rate-limit {

responses-per-second 10;

window 5;

slip 2;

};

같은 소스에서 응답을 제한하여 증폭 공격을 방지합니다.

#### Query 필터링

# Block ANY queries (common in amplification)

# Block excessively long queries

# Block known-malicious patterns

BIND 예:
# Block ANY queries

match-query {

type ANY;

action drop;

};

DNS 공급자 수준 방어

# # # # # DNSSEC

직접 홍수 방지, DNSSEC :

숨겨진 마스터 구성

Master server (hidden):    10.0.0.1 (not publicly known)

Slave servers (public): ns1.example.com, ns2.example.com

Attackers target slaves

Master remains operational

Can quickly update slaves if needed

DNS 방화벽/IDS

Analyze queries in real-time

Block suspicious patterns

Whitelist known-good clients

Blacklist attack sources

신청 수준 보호

#### 응답률 제한 (RRL)

Limit identical responses to same client

Prevents amplification attacks

Slip mode: Occasionally allow queries through (to not break legitimate recursive resolvers)

BIND 구성 :
options {

rate-limit {

responses-per-second 5;

referrals-per-second 5;

nodata-per-second 5;

nxdomains-per-second 5;

errors-per-second 5;

window 5;

};

};

#### 캐시 최적화

Increase cache size to absorb repeated queries

Longer TTLs where appropriate (trade-off with agility)

Prefetch popular records

#### Query 필터링

# Drop queries for non-existent zones

# Block queries from known-bad sources

# Rate-limit per-source queries

네트워크 수준 방어

# # # # # BGP 블랙홀딩

Route attack traffic to null0

Sacrifice availability to preserve infrastructure

Last resort when attack overwhelms capacity

# # # # # 업스트림 ISP 필터링

Coordinate with ISP to filter attack traffic

Source IP validation (prevent spoofing)

Traffic scrubbing centers

# DDoS 완화 서비스

Cloudflare, Akamai, AWS Shield

Absorb attack traffic before reaching your servers

Global capacity to withstand large attacks

DNS 탄력성에 대한 모범 사례

여러 DNS 공급자 사용

Primary provider: Cloudflare

Secondary provider: AWS Route 53

If one is attacked/down, other continues serving

Different infrastructure reduces single point of failure

DNSSEC 구현

Protects against DNS spoofing/cache poisoning

Maintains integrity during attacks

Build trust even under attack conditions

모니터 DNS 성능

Real-time query rates

Response times

NXDOMAIN percentages

Geographic distribution of queries

Error rates

도구: Grafana + Prometheus, Datadog, AWS CloudWatch

정규적인 수용량 테스트

Load testing: Can infrastructure handle 10x traffic?

Failover testing: Do secondary providers activate correctly?

Attack simulation: Test mitigation strategies

Authoritative Servers에 대한 반복성

# BIND

recursion no;

Authoritative nameservers는 recursive resolvers로 동작하지 않아야 합니다.

제한 영역 전송

# BIND

allow-transfer { 10.0.0.2; 10.0.0.3; }; # Only specific slaves

전체 영역 덤프에서 공격자를 방지합니다.

소프트웨어 업데이트 유지

Regularly update DNS server software

Patch known vulnerabilities

Subscribe to security advisories

Active DNS 홍수 공격 대응

Immediate 활동

1. 진행 공격이 발생한다

# Check query rate

rndc status

# Check load

top

2. 한도 제한

# BIND: Enable RRL if not already active

rndc addzone rate-limit

3. 문의 DDoS 완화 제공 업체

- 스크랩 서비스 활성화

- Mitigation Network를 통한 간접 트래픽

4. 아날로그 공격 패턴

# Top query types

grep "query" /var/log/named/queries.log | awk '{print $6}' | sort | uniq -c | sort -rn | head -20

# Top queried domains

grep "query" /var/log/named/queries.log | awk '{print $7}' | sort | uniq -c | sort -rn | head -20

5. Block 명백한 공격 소스

# Identify top source IPs

grep "query" /var/log/named/queries.log | awk '{print $5}' | cut -d# -f1 | sort | uniq -c | sort -rn | head -50

# Block at firewall

iptables -A INPUT -s ATTACKER_IP -j DROP

Medium-Term 액션

1. Scale 인프라

- 더 많은 nameserver 용량 추가

- 이미없는 경우 anycast를 통해 분산

2. 추가 필터링

- 공격에 특정 블록 쿼리 패턴

- Whitelist 알려진 좋은 소스

3. 공급자와의 협조

- ISP/hosting 공급자

- DNS 공급자

- DDoS 완화 서비스

4. Document 공격

- Packet 캡처

- 로그인

- 교통 그래프

- post-incident 분석 및 법적 목적

Post-Attack 분석

1. 완화의 효과

2. 인프라 약점 확인

3. 업데이트 사건 대응 절차

4. Consider 장기 개선 (다프로바이더 DNS, 더 큰 용량)

법률 및 보고

작성자에 대한 보고서

Evidence 컬렉션

# Packet captures

tcpdump -i eth0 -w dns-attack.pcap port 53

# Full query logs

tar -czf attack-logs-$(date +%Y%m%d).tar.gz /var/log/named/

# Traffic graphs/screenshots

# System resource usage

DNS 홍수 공격은 온라인 서비스에 심각한 위협이지만 적절한 인프라, 모니터링 및 완화 전략을 통해 영향을 최소화 할 수 있습니다.

이 지식을 활용하세요

DomScan의 API를 사용하여 도메인 가용성, 상태 등을 확인하세요.