Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Learning DNS in 10 years
Search
Julia Evans
February 01, 2023
Technology
0
170
Learning DNS in 10 years
From RubyConf Mini 2022
Julia Evans
February 01, 2023
Tweet
Share
More Decks by Julia Evans
See All by Julia Evans
Blogging myths
jvns
0
3.3k
High Reliability Infrastructure migrations
jvns
10
13k
Building a Ruby profiler
jvns
2
380
Build impossible programs
jvns
23
94k
So you want to be a wizard
jvns
25
25k
Learning systems programming with Rust
jvns
14
7.7k
Systems programming is for everyone
jvns
13
3.1k
How to read your computer's mind
jvns
6
780
Why I ❤ Rust
jvns
50
53k
Other Decks in Technology
See All in Technology
GeminiとNotebookLMによる金融実務の業務革新
abenben
0
150
ローカルLLMでファインチューニング
knishioka
0
130
LinkX_GitHubを基点にした_AI時代のプロジェクトマネジメント.pdf
iotcomjpadmin
0
160
BigQuery Remote FunctionでLooker Studioをインタラクティブ化
cuebic9bic
2
230
白金鉱業Meetup_Vol.19_PoCはデモで語れ!顧客の本音とインサイトを引き出すソリューション構築
brainpadpr
2
490
PHP開発者のためのSOLID原則再入門 #phpcon / PHP Conference Japan 2025
shogogg
1
370
ハノーバーメッセ2025座談会.pdf
iotcomjpadmin
0
150
TechLION vol.41~MySQLユーザ会のほうから来ました / techlion41_mysql
sakaik
0
150
VCpp Link and Library - C++ breaktime 2025 Summer
harukasao
0
220
20250623 Findy Lunch LT Brown
3150
0
790
エンジニア向け技術スタック情報
kauche
0
110
~宇宙最速~2025年AWS Summit レポート
satodesu
1
1.4k
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
69
11k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
920
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
4 Signs Your Business is Dying
shpigford
184
22k
Site-Speed That Sticks
csswizardry
10
650
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
Bash Introduction
62gerente
614
210k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.8k
Transcript
None
None
None
None
None
None
None
notice when you're confused read the specification do experiments spy
on it what's DNS? implement your own terrible version
None
None
None
None
None
notice when you're confused read the specification do experiments spy
on it what's DNS? implement your own terrible version
None
None
$ dig example.com example.com. 86400 IN A 93.184.216.34
$ dig example.com example.com. 86400 IN A 93.184.216.34
+noall +answer .digrc
None
None
None
None
None
browser resolver authoritative nameservers DNS query DNS query where's example.com?
where's example.com? 93.184.216.34! 93.184.216.34!
resolver browser what's the IP for example.com? hmm, I'll look
in my cache...
None
None
None
None
None
None
None
browser resolver authoritative nameservers DNS query DNS query where's new.jvns.ca?
where's new.jvns.ca? NXDOMAIN NXDOMAIN
None
None
None
“The TTL of this record is set from the minimum
of the MINIMUM field of the SOA record and the TTL of the SOA itself, and indicates how long a resolver may cache the negative answer.”
None
$ dig +all new.jvns.ca ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN,
id: 23308 [redacted] ;; AUTHORITY SECTION: jvns.ca. 10800 IN SOA ns1.gandi.net. hostmaster.gandi.net. 1662903879 10800 3600 604800 10800
None
None
None
None
None
None
None
None
browser resolver authoritative nameservers DNS query DNS query where's example.com?
where's example.com? 93.184.216.34! 93.184.216.34!
None
None
None
None
require 'socket' sock = UDPSocket.new sock.bind('0.0.0.0', 0) sock.connect('8.8.8.8', 53)
None
hex_string = "b9620100000100..." bytes = [hex_string].pack('H*') sock.send(bytes, 0)
b96201000001000000000000 076578616d706c6503636f6d0000010001
b96201000001000000000000 076578616d706c6503636f6d0000010001
b96201000001000000000000
def make_question_header(query_id) # id, flags, num questions, num answers, ...
[query_id, 0x0100, 0x0001, 0x0000, 0x0000, 0x0000] .pack('nnnnnn') end
b96201000001000000000000 076578616d706c6503636f6d0000010001
076578616d706c6503636f6d0000010001 7 e x a m p l e 3
c o m 0 1 1
def encode_domain_name(domain) domain.split('.') .map { |x| x.length.chr + x }
.join + "\0" end example.com 7example3com0
def make_dns_query(domain, type) query_id = rand(65535) header = make_question_header(query_id) question
= encode_domain_name(domain) + [type, 1].pack('nn') header + question end
None
None
None
notice when you're confused read the specification do experiments spy
on it implement your own terrible version
None