38
An Update on Anomalous DNS Behavior Duane Wessels The Measurement Factory, and CAIDA [email protected] NANOG 29 October 2003 NANOG 29 The Measurement Factory

An Update on Anomalous DNS Behavior · An Update on Anomalous DNS Behavior Duane Wessels The Measurement Factory, and CAIDA [email protected] NANOG 29 October 2003 NANOG

  • Upload
    letuyen

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

An Update on Anomalous DNS Behavior

Duane Wessels

The Measurement Factory, and

CAIDA

[email protected]

NANOG 29

October 2003

NANOG 29 The Measurement Factory

Motivation

• Why are root servers getting slammed?

• Are caching/forwarding DNS servers doing the right thing?

• How does a caching nameserver distribute its load to multiple

nameservers?

• Do some implementations abuse the system more than oth-

ers?

NANOG 29 The Measurement Factory

The Setup

A Test Network

Root

TLDs

(authoritative)SLDs

User

Cachewith packet lossand delays

Simulated WAN

NANOG 29 The Measurement Factory

Workload

• Hostnames taken from 12 hours worth of caching proxy logs

• 5,532,641 Million DNS requests

• 107,777 unique hostnames

• 70,365 second-level domains

• 431 top-level domains

• 1 Root

NANOG 29 The Measurement Factory

Synthetic Zone Files

• Root & TLD zones use real values for:

– Number of nameservers

– NS, glue TTLs

• SLD zones use random values derived from sample of real

zone data for:

– Number of A records per name

– A, NS, CNAME TTLs

• Each SLD zone has two nameservers (ns0, ns1)

• Global 35% probability that a name is a CNAME record

NANOG 29 The Measurement Factory

Example SLD Zone$ORIGIN org.@ 8640 IN SOA org. root.org.

( 1 720 360 604800 8640 )

@ 51840 IN NS ns0.org.51840 IN NS ns1.org.51840 IN NS ns2.org.51840 IN NS ns3.org.51840 IN NS ns4.org.51840 IN NS ns5.org.51840 IN NS ns6.org.51840 IN NS ns7.org.51840 IN NS ns8.org.

ns0 51840 IN A 192.168.3.41ns1 51840 IN A 192.168.3.42ns2 51840 IN A 192.168.3.43ns3 51840 IN A 192.168.3.44ns4 51840 IN A 192.168.3.45ns5 51840 IN A 192.168.3.46ns6 51840 IN A 192.168.3.47ns7 51840 IN A 192.168.3.48ns8 51840 IN A 192.168.3.49

$ORIGIN 0-vip.org.@ 30 IN NS ns0.0-vip.org.

30 IN NS ns1.0-vip.org.ns0 2143 IN A 192.168.4.215ns1 2143 IN A 192.168.4.216

$ORIGIN 0xdeadbeef.org.@ 1440 IN NS ns0.0xdeadbeef.org.

1440 IN NS ns1.0xdeadbeef.org.ns0 8640 IN A 192.168.4.95ns1 8640 IN A 192.168.4.96

$ORIGIN 1000traveltips.org.@ 30 IN NS ns0.1000traveltips.org.

30 IN NS ns1.1000traveltips.org.ns0 8640 IN A 192.168.4.27ns1 8640 IN A 192.168.4.28

$ORIGIN 1128.org.@ 1440 IN NS ns0.1128.org.

1440 IN NS ns1.1128.org.ns0 90 IN A 192.168.4.127ns1 90 IN A 192.168.4.128

NANOG 29 The Measurement Factory

Caching NS Software Tested

• BIND 8.4.3

• BIND 9.2.1

• DJBDNS 1.05 (a.k.a. dnscache)

• Windows 2000 (v5.0.49664)

• Windows 2003 (v5.2.3790.0)

Root, TLD, SLD servers always run BIND 8.4.3.

NANOG 29 The Measurement Factory

Test Configurations

1. No delay, no packet loss

2. 100ms delay, no packet loss

3. Linear delays, no packet loss

4. Linear delays, 5% packet loss

5. Linear delays, 25% packet loss

6. No delay, 100% packet loss

Delays and packet loss are implemented using FreeBSD’s Dum-

mynet. They are placed on the Root, TLD, and SLD servers.

NANOG 29 The Measurement Factory

Linear Delays

40

60

80

100

120

140

160

A B C D E F G H I J K L M

Pac

ket D

elay

s, m

illis

econ

ds

Nameserver

NANOG 29 The Measurement Factory

Some Results

No delays, no packet loss

0

0.2

0.4

0.6

0.8

1

1.2

bind8 bind9 djbdns w2000 w2003

Mill

ions

of q

uerie

s se

nt (

cum

ulat

ive)

Software

delay0-loss0

+SLDs+TLDs

roots

For example, BIND 9 sent 548,671 total queries, 55,329 to the

Roots, 144,723 to the TLDs, and 348,619 to the SLDs.

NANOG 29 The Measurement Factory

Linear delays, 5% packet loss

0

0.2

0.4

0.6

0.8

1

1.2

bind8 bind9 djbdns w2000 w2003

Mill

ions

of q

uerie

s se

nt (

cum

ulat

ive)

Software

delaylinear-loss5

+SLDs+TLDs

roots

About the same as the previous slide; just slightly higher in most

categories.

NANOG 29 The Measurement Factory

BIND 8 Sends The Most Queries

• Sends A, AAAA, and A6 queries to Roots, SLDs, and TLDs

for expired NS addresses.

• Forwards cache misses for pending hits.

– (djbdns, w2000, w2003 do this too)

NANOG 29 The Measurement Factory

Forwarding Cache Missesfor Pending Hits

16:43:19.489271 USER.1756 > BIND8.53: 7+ A? www.popularsite.com.16:43:19.491460 USER.1756 > BIND8.53: 11+ A? www.popularsite.com.16:43:19.494532 BIND8.1041 > ROOT.11.53: 25426 A? www.popularsite.com.16:43:19.495513 BIND8.1041 > ROOT.11.53: 32628 A? www.popularsite.com.16:43:19.495855 ROOT.11.53 > BIND8.1041: 25426- 0/13/1416:43:19.497446 ROOT.11.53 > BIND8.1041: 32628- 0/13/1416:43:19.497648 TLD.68.53 > BIND8.1041: 1217- 0/2/316:43:19.504748 BIND8.1041 > TLD.3.53: 21305 A? www.popularsite.com.16:43:19.505638 TLD.3.53 > BIND8.1041: 21305- 0/2/316:43:19.506783 BIND8.1041 > SLD.118.53: 55782 A? www.popularsite.com.16:43:19.507983 BIND8.1041 > SLD.118.53: 39986 A? www.popularsite.com.16:43:19.509285 USER.1756 > BIND8.53: 13+ A? www.popularsite.com.16:43:19.509522 SLD.118.53 > BIND8.1041: 55782*- 1/2/3 A 25.240.249.3116:43:19.509743 SLD.118.53 > BIND8.1041: 39986*- 1/2/3 A 25.240.249.3116:43:19.510225 BIND8.1041 > SLD.118.53: 38069 A? www.popularsite.com.16:43:19.511444 USER.1756 > BIND8.53: 16+ A? www.popularsite.com.16:43:19.511729 SLD.118.53 > BIND8.1041: 38069*- 1/2/3 A 25.240.249.3116:43:19.511729 SLD.118.53 > BIND8.1041: 38069*- 1/2/3 A 25.240.249.3116:43:19.516474 BIND8.53 > USER.1756: 7* 1/2/2 A 25.240.249.3116:43:19.516907 BIND8.53 > USER.1756: 11* 1/2/2 A 25.240.249.3116:43:19.521322 BIND8.53 > USER.1756: 13* 1/2/2 A 25.240.249.3116:43:19.522298 BIND8.53 > USER.1756: 16 1/2/2 A 25.240.249.31

NANOG 29 The Measurement Factory

Why So Many BIND 9 Queries to Roots?

• bind9 re-queries for expired glue starting at the root.

• Sends A and A6 queries for both SLD nameservers.

21:18:35.998866 BIND9.1041 > ROOT.1.53: 17639 A? ns0.iastate.edu.21:18:36.000520 BIND9.1041 > ROOT.1.53: 7798 A6? ns0.iastate.edu.21:18:36.002224 BIND9.1041 > ROOT.1.53: 51091 A? ns1.iastate.edu.21:18:36.003895 BIND9.1041 > ROOT.1.53: 36953 A6? ns1.iastate.edu.

• Real-world:

;; ANSWER SECTION:microsoft.com. 1H IN NS dns1.cp.msft.net.microsoft.com. 1H IN NS dns1.sj.msft.net.microsoft.com. 1H IN NS dns1.tk.msft.net.microsoft.com. 1H IN NS dns3.uk.msft.net.

;; ADDITIONAL SECTION:dns1.cp.msft.net. 1H IN A 207.46.138.20dns1.sj.msft.net. 1H IN A 65.54.248.222dns1.tk.msft.net. 1H IN A 207.46.245.230dns3.uk.msft.net. 1H IN A 213.199.144.151

NANOG 29 The Measurement Factory

djbdns Also has a lot of Root Queries

• djbdns re-queries for expired glue starting at the root.

• But only for first nameserver

• Only A queries

• djbdns does not trust “additional” answers with TTL 0 andre-queries for them starting at the root.

20:33:55.902072 USER.1805 > DJBDNS.53: 295+ A? www3.kwyjibo.com.20:33:55.906091 DJBDNS.7410 > TLD.9.53: 1206 A? www3.kwyjibo.com.20:33:55.906704 TLD.9.53 > DJBDNS.7410: 1206- 0/2/220:33:55.908634 DJBDNS.10380 > ROOT.13.53: 2361 A? ns0.kwyjibo.com.20:33:55.909236 ROOT.13.53 > DJBDNS.10380: 2361- 0/13/1320:33:55.913527 DJBDNS.5244 > TLD.12.53: 32554 A? ns0.kwyjibo.com.20:33:55.914155 TLD.12.53 > DJBDNS.5244: 32554- 1/2/2 A SLD.6720:33:55.925028 DJBDNS.60070 > SLD.68.53: 19539 A? ns0.kwyjibo.com.20:33:55.925751 SLD.68.53 > DJBDNS.60070: 19539*- 1/2/2 A SLD.6720:33:55.954061 DJBDNS.44857 > SLD.68.53: 30676 A? www3.kwyjibo.com.20:33:55.954797 SLD.68.53 > DJBDNS.44857: 30676*- 1/2/2 A 50.233.168.1620:33:55.961632 DJBDNS.53 > USER.1805: 295 1/0/0 A 50.233.168.16

NANOG 29 The Measurement Factory

BIND 8

0

0.2

0.4

0.6

0.8

1

1.2

1.4

0/0 100/0 linear/0 linear/5 linear/25

Mill

ions

of q

uerie

s se

nt (

cum

ulat

ive)

test (delays/pktloss)

bind8

+SLDs+TLDs

roots

BIND8 actually sends slighly fewer queries in “harsher” condi-tions. For example, 383,995 TLD queries in 0ms/0% test, butonly 344,628 in linear/5% test.

NANOG 29 The Measurement Factory

BIND 9

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

0/0 100/0 linear/0 linear/5 linear/25

Mill

ions

of q

uerie

s se

nt (

cum

ulat

ive)

test (delays/pktloss)

bind9

+SLDs+TLDs

roots

Unaffected by delays, only by loss.

NANOG 29 The Measurement Factory

DJBDNS

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0/0 100/0 linear/0 linear/5 linear/25

Mill

ions

of q

uerie

s se

nt (

cum

ulat

ive)

test (delays/pktloss)

djbdns

+SLDs+TLDs

roots

NANOG 29 The Measurement Factory

Windows 2000

0

0.1

0.2

0.3

0.4

0.5

0.6

0/0 100/0 linear/0 linear/5 linear/25

Mill

ions

of q

uerie

s se

nt (

cum

ulat

ive)

test (delays/pktloss)

w2000

+SLDs+TLDs

roots

NANOG 29 The Measurement Factory

Windows 2003

0

0.1

0.2

0.3

0.4

0.5

0.6

0/0 100/0 linear/0 linear/5 linear/25

Mill

ions

of q

uerie

s se

nt (

cum

ulat

ive)

test (delays/pktloss)

w2003

+SLDs+TLDs

roots

NANOG 29 The Measurement Factory

No delays, 100% packet loss

0

10

20

30

40

50

60

70

bind8 bind9 djbdns w2000 w2003

Mill

ions

of q

uerie

s se

nt (

cum

ulat

ive)

Software

delay0-loss100

+SLDs+TLDs

roots

Wow!

NANOG 29 The Measurement Factory

No delays, 100% packet loss

0

500

1000

1500

2000

2500

0 5000 10000 15000 20000 25000 30000 35000 40000

Que

ries

per

seco

nd

Time, seconds

bind8bind9

djbdnsw2000w2003

user

Most software amplifies the user query rate, but BIND9 attenu-

ates.

NANOG 29 The Measurement Factory

“DNS servers on the other hand track

RTTs for query responses and really

*know* which server is the fastest rather

than guess based on third hand routing

information.”

–Iljitsch van Beijnum, 18 Sep 2003

Distribution of Queries to Nameservers

0

50

100

150

200

250

300

350

400

A B C D E F G H I J K L M0

5000

10000

15000

20000

25000

30000

35000

40000

45000

50000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

NANOG 29 The Measurement Factory

BIND 80ms/0%

0

200

400

600

800

1000

1200

1400

1600

1800

A B C D E F G H I J K L M0

50000

100000

150000

200000

250000

300000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

100ms/0%

0

20

40

60

80

100

120

140

160

180

200

A B C D E F G H I J K L M0

5000

10000

15000

20000

25000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

0ms/100%

0

500000

1e+06

1.5e+06

2e+06

2.5e+06

3e+06

3.5e+06

4e+06

4.5e+06

A B C D E F G H I J K L0

500000

1e+06

1.5e+06

2e+06

2.5e+06

3e+06

3.5e+06

4e+06

4.5e+06

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots

linear/0%

0

50

100

150

200

250

300

350

400

A B C D E F G H I J K L M0

5000

10000

15000

20000

25000

30000

35000

40000

45000

50000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/5%

0

50

100

150

200

250

300

350

400

A B C D E F G H I J K L M0

5000

10000

15000

20000

25000

30000

35000

40000

45000

50000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/25%

0

50

100

150

200

250

300

350

A B C D E F G H I J K L M0

5000

10000

15000

20000

25000

30000

35000

40000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

NANOG 29 The Measurement Factory

BIND 90ms/0%

0

500

1000

1500

2000

2500

3000

3500

4000

4500

A B C D E F G H I J K L M0

1000

2000

3000

4000

5000

6000

7000

8000

9000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

100ms/0%

0

500

1000

1500

2000

2500

3000

3500

4000

4500

A B C D E F G H I J K L M0

1000

2000

3000

4000

5000

6000

7000

8000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

0ms/100%

0

50000

100000

150000

200000

250000

A B C D E F G H I J K L0

50000

100000

150000

200000

250000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots

linear/0%

0

2000

4000

6000

8000

10000

12000

A B C D E F G H I J K L M0

5000

10000

15000

20000

25000

30000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/5%

0

2000

4000

6000

8000

10000

12000

A B C D E F G H I J K L M0

5000

10000

15000

20000

25000

30000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/25%

0

2000

4000

6000

8000

10000

12000

14000

A B C D E F G H I J K L M0

5000

10000

15000

20000

25000

30000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

NANOG 29 The Measurement Factory

DJBDNS0ms/0%

0

200

400

600

800

1000

1200

1400

1600

1800

2000

A B C D E F G H I J K L M0

1000

2000

3000

4000

5000

6000

7000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

100ms/0%

0

500

1000

1500

2000

2500

A B C D E F G H I J K L M0

1000

2000

3000

4000

5000

6000

7000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

0ms/100%

0

100000

200000

300000

400000

500000

600000

700000

800000

900000

1e+06

A B C D E F G H I J K L0

100000

200000

300000

400000

500000

600000

700000

800000

900000

1e+06

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots

linear/0%

0

500

1000

1500

2000

2500

A B C D E F G H I J K L M0

1000

2000

3000

4000

5000

6000

7000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/5%

0

500

1000

1500

2000

2500

A B C D E F G H I J K L M0

1000

2000

3000

4000

5000

6000

7000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/25%

0

500

1000

1500

2000

2500

3000

3500

A B C D E F G H I J K L M0

1000

2000

3000

4000

5000

6000

7000

8000

9000

10000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

NANOG 29 The Measurement Factory

Windows 20000ms/0%

0

100

200

300

400

500

600

700

A B C D E F G H I J K L M0

10000

20000

30000

40000

50000

60000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

100ms/0%

0

100

200

300

400

500

600

700

A B C D E F G H I J K L M0

10000

20000

30000

40000

50000

60000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

0ms/100%

0

1e+06

2e+06

3e+06

4e+06

5e+06

6e+06

A B C D E F G H I J K L M0

0.2

0.4

0.6

0.8

1

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/0%

0

100

200

300

400

500

600

700

A B C D E F G H I J K L M0

10000

20000

30000

40000

50000

60000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/5%

0

100

200

300

400

500

600

700

A B C D E F G H I J K L M0

10000

20000

30000

40000

50000

60000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/25%

0

100

200

300

400

500

600

700

800

A B C D E F G H I J K L M0

10000

20000

30000

40000

50000

60000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

Seems to always choose first .com nameserver.

NANOG 29 The Measurement Factory

Windows 20030ms/0%

0

10

20

30

40

50

60

70

80

90

100

A B C D E F G H I J K L M0

1000

2000

3000

4000

5000

6000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

100ms/0%

0

20

40

60

80

100

120

A B C D E F G H I J K L M0

1000

2000

3000

4000

5000

6000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

0ms/100%

0

1e+06

2e+06

3e+06

4e+06

5e+06

6e+06

A B C D E F G H I J K L0

1e+06

2e+06

3e+06

4e+06

5e+06

6e+06

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots

linear/0%

0

10

20

30

40

50

60

70

80

90

100

A B C D E F G H I J K L M0

1000

2000

3000

4000

5000

6000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/5%

0

20

40

60

80

100

120

140

A B C D E F G H I J K L M0

2000

4000

6000

8000

10000

12000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

linear/25%

0

20

40

60

80

100

120

140

160

180

200

A B C D E F G H I J K L M0

2000

4000

6000

8000

10000

12000

Que

ries

to R

oots

Que

ries

to .c

om T

LDs

roots.com

NANOG 29 The Measurement Factory

“Scientists at the San Diego

Supercomputer Center found that 98% of

the Slashdot comments at the root level are

unnecessary.”

–Anonymous Coward

Punchline from Last Year’s Talk

Type Count PercentRepeated QNAME 68,610,091 44.9Repeat Query 38,838,688 25.4Unknown TLD 19,165,840 12.5A for A 10,739,857 7.03Referral Not Cached 6,653,690 4.36Legitimate 3,284,569 2.15Nonprintable in QNAME 2,962,471 1.94rfc1918 PTR 2,452,806 1.61Unused Query Class 36,313 .024

NANOG 29 The Measurement Factory

Run Simulations Through Earlier RootServer Analysis Tools

What happens when we run one of the simulated Root server

traces through the tools used to analyze real root server

activity in last year’s talk?

bind8 bind9 djbdns w2000 w2003unknown-tld 20.2 0.7 1.2 73.0 64.3repeated-query 0.0 0.0 0.0 0.0 0.8repeated-qname 23.1 31.4 51.7 2.5 0.8referral-not-ca 21.1 64.2 43.4 0.9 7.8legit 35.6 3.7 3.7 23.6 26.4

oops. Learned that some software always goes back to the roots

for expired NS addresses.

NANOG 29 The Measurement Factory

Run Simulations Through Earlier RootServer Analysis Tools

What happens if we exclude queries for (expired) NS

addresses?

bind8 bind9 djbdns w2000 w2003unknown-tld 39.7 64.3 69.0 73.0 65.9repeated-query 0.0 0.0 0.0 0.0 0.8repeated-qname 17.9 0.0 0.0 2.5 0.8referral-not-ca 6.1 0.9 2.4 0.9 7.1legit 36.3 34.8 28.6 23.6 25.4

oops? Some TLDs have short TTLs on NS addresses. Earlier

study assumed TLD TTLS 24 hours or greater. But is it as

simple as that?

NANOG 29 The Measurement Factory

Conclusions — Balancing

• BIND 8 can latch on to a single nameserver in low loss/latency

conditions, but we didn’t determine the threshold.

• DJBDNS uses uniform distribution among nameservers re-

gardless of conditions.

• W2000 server selection sucks.

• W2003 server selection only slightly better.

NANOG 29 The Measurement Factory

Conclusions — Abuse

• A6 and AAAA queries on IPv6-enabled machines may be

abusing Root, TLD, SLD nameservers.

• BIND9 does not forward cache misses for pending hits. cool.

• BIND9 is the only software tested that attenuates the user

queries in the event of 100% packet loss.

• Need to improve our models for analyzing root server abuse.

Must consider BIND9 and DJBDNS’s techniques to prevent

cache poisoning.

NANOG 29 The Measurement Factory

The End