+ All Categories
Home > Technology > A Definitive Guide to DNS Time To Live

A Definitive Guide to DNS Time To Live

Date post: 14-Apr-2017
Category:
Upload: varonis
View: 251 times
Download: 0 times
Share this document with a friend
63
DEFINITIVE GUIDE TO DNS TIME TO LIVE
Transcript
Page 1: A Definitive Guide to DNS Time To Live

DEFINITIVE GUIDE TO DNS TIME TO LIVE

Page 2: A Definitive Guide to DNS Time To Live

THE BASICS

Page 3: A Definitive Guide to DNS Time To Live

What is a DNS Record?

104.196.44.111

www.varonis.com

Page 4: A Definitive Guide to DNS Time To Live

Why is DNS cached?

Page 5: A Definitive Guide to DNS Time To Live

Why is DNS cached?

1 Time. DNS Requests are slow.

Page 6: A Definitive Guide to DNS Time To Live

Why is DNS cached?

2 Stability. DNS Records don’t change often (typically years)

Page 7: A Definitive Guide to DNS Time To Live

What’s a TTL?

Page 8: A Definitive Guide to DNS Time To Live

What’s a TTL?

How long each step of the DNS resolution chain will cache a record.

Page 9: A Definitive Guide to DNS Time To Live

What are typical TTL

times?

Page 10: A Definitive Guide to DNS Time To Live

What are typical TTL?

“Very Short” “Short" “Long" “Insanity"

300s / 5min 3600s / 1h 86400s / 24h 604800s / 7d

Page 11: A Definitive Guide to DNS Time To Live

How do DNS Lookups

Work?

Page 12: A Definitive Guide to DNS Time To Live

How do lookups work?

All DNS clients ask:

Page 13: A Definitive Guide to DNS Time To Live

How do lookups work?

1 Do we have this record cached?

Page 14: A Definitive Guide to DNS Time To Live

Why is DNS cached?

2 If it is cached, is the TTL still valid?

Page 15: A Definitive Guide to DNS Time To Live

How do lookups work?

If the answer to either is “no” the request moves up the chain and the questions are asked again.

Page 16: A Definitive Guide to DNS Time To Live

Why DNS is about Network

Connections not Devices

Page 17: A Definitive Guide to DNS Time To Live

Connections not Devices

Consider your home computer

Page 18: A Definitive Guide to DNS Time To Live

Connections not Devices

Your connect via - high speed internet - tethered cell - a VPN on top of both

Page 19: A Definitive Guide to DNS Time To Live

Connections not Devices

Those connections have: - different ISP DNS servers - different DNS cache policy

Page 20: A Definitive Guide to DNS Time To Live

Connections not Devices

Entirely possible to have two different DNS resolution

results by switching connections

Page 21: A Definitive Guide to DNS Time To Live

DNS TTL TROUBLE SHOOTING

Page 22: A Definitive Guide to DNS Time To Live

How long does it take for DNS

to update?

Page 23: A Definitive Guide to DNS Time To Live

How long until updated?

WORST CASE: TTL for record * number of resolution steps in chain

Page 24: A Definitive Guide to DNS Time To Live

How long until updated?

BEST CASE: TTL has expired for all steps (no cache) so it’s immediate

Page 25: A Definitive Guide to DNS Time To Live

How much does a DNS lookup cost?

Page 26: A Definitive Guide to DNS Time To Live

DNS lookup cost

An uncached DNS request takes ~150ms

Page 27: A Definitive Guide to DNS Time To Live

DNS lookup cost

A typical website makes 100s of requests

Page 28: A Definitive Guide to DNS Time To Live

DNS lookup cost

Without caching EVERY REQUEST would add 150ms

to the page load time

Page 29: A Definitive Guide to DNS Time To Live

DNS lookup cost

With caching, only the first request to each domain

takes additional time.

Page 30: A Definitive Guide to DNS Time To Live

Why isn’t my DNS

updating?

Page 31: A Definitive Guide to DNS Time To Live

Why isn’t DNS updating?

1 Application caches: For example, Internet Explorer ignores TTLs lower than 30 min

Page 32: A Definitive Guide to DNS Time To Live

Why isn’t DNS updating?

2 Mobile ISPs seek to reduce traffic by boosting TTL times

Page 33: A Definitive Guide to DNS Time To Live

Why isn’t DNS updating?

3 Complex internal networks with more DNS servers than you would think

Page 34: A Definitive Guide to DNS Time To Live

Can you remotely force a client to

update their DNS?

Page 35: A Definitive Guide to DNS Time To Live

Force client DNS update

NO

Page 36: A Definitive Guide to DNS Time To Live

Force client DNS update

You can purge local DNS caches, but not on downstream clients

Page 37: A Definitive Guide to DNS Time To Live

DNS BEST PRACTICES

Page 38: A Definitive Guide to DNS Time To Live

WHAT’S BETTER: SHORT OR LONG TTLs?

Page 39: A Definitive Guide to DNS Time To Live

Short or Long TTL?

Short: less than one hour(3600 seconds)

Page 40: A Definitive Guide to DNS Time To Live

Short or Long TTL?

Short TTLs give you much greater flexibility in making

changes and working around the most common DNS

problems

Page 41: A Definitive Guide to DNS Time To Live

How do you know when a client will update their DNS

record?

Page 42: A Definitive Guide to DNS Time To Live

Estimate update time?

TTL is not a “freshness date”

Page 43: A Definitive Guide to DNS Time To Live

Estimate update time?

DNS is like an org chart. !

Changes take time to propagate through the whole

organization.

Page 44: A Definitive Guide to DNS Time To Live

What’s the best practice for

changing a DNS record?

Page 45: A Definitive Guide to DNS Time To Live

Best Change Practice

1 Drop the TTL on the record to very low: (5 min/300 seconds)

Page 46: A Definitive Guide to DNS Time To Live

Best Change Practice

2 Modify the actual record on the cutover date

Page 47: A Definitive Guide to DNS Time To Live

Best Change Practice

3 Several days post switch, push the TTL back to something higher (1hr / 3600s)

Page 48: A Definitive Guide to DNS Time To Live

Best Practice for adding a new DNS record?

Page 49: A Definitive Guide to DNS Time To Live

Best Change Practice

1 Add the new record with low TTL.

Page 50: A Definitive Guide to DNS Time To Live

Best Change Practice

2 After you’re sure everything works, raise the TTL.

Page 51: A Definitive Guide to DNS Time To Live

What’s the most common TTL Setting?

Page 52: A Definitive Guide to DNS Time To Live

Most Common TTL

Rather than guess, we wrote a program to check the top 500 websites.

Page 53: A Definitive Guide to DNS Time To Live

Most Common TTL

Lowest TTL 1

Highest TTL 129,540

Domains Resolved: 485

Average TTL: 6,468

Median TTL: 300

TTL Results

Page 54: A Definitive Guide to DNS Time To Live

Most Common TTL

The lowest values are from domains doing rapid DNS changes for load balancing.

Page 55: A Definitive Guide to DNS Time To Live

Most Common TTL

If you need to defend TTL decision, point to the 300 second median value.

Page 56: A Definitive Guide to DNS Time To Live

What are the DNS Platform

Tools?

Page 57: A Definitive Guide to DNS Time To Live

Check DNS on Windows

C:\>nslookup -type=cname -debug www.varonis.com

Page 58: A Definitive Guide to DNS Time To Live

Check DNS Unix/OSX

dig www.varonis.com

Page 59: A Definitive Guide to DNS Time To Live

Check DNS from Web

https://toolbox.googleapps.com/apps/dig/

Page 60: A Definitive Guide to DNS Time To Live

How do I test for DNS TTL propagation?

Page 61: A Definitive Guide to DNS Time To Live

Check DNS from Web

http://whatsmydns.net/

Page 62: A Definitive Guide to DNS Time To Live

WHAT TO DO NEXT


Recommended