2013 11 Dnssec Tutorial
2013 11 Dnssec Tutorial
Shumon Huque
University of Pennsylvania
DNSSEC Tutorial
2013,2014 Shumon Huque.
Who am I?
An I.T. Director at the University of Pennsylvania
Have also been:
Programmer (C, Perl, Python, Lisp)
UNIX Systems Administrator
Network Engineer
Education: B.S. and M.S. (Computer Science) from Penn
Also teach a Lab course on Network Protocols at Penns
School of Engineering & Applied Science
Website: http://www.huque.com/~shuque/
Blog: http://blog.huque.com/
Twitter: https://twitter.com/shuque @shuque
Google Plus: https://plus.google.com/+ShumonHuque
Course Topics
1. DNSSEC Tutorial
2. Live queries using dig
3. Configuring DNSSEC in BIND
4. Application uses of DNSSEC
5. DNSSEC deployment status
For review
DNS
91.130.in-addr.arpa
91
[DNSSEC Tutorial, USENIX LISA 13]
Zone
11
Server Side:
Authoritative Servers
Resolvers (Recursive Resolvers)
Client Side:
Stub resolvers (usually on DNS client machines)
Resolver
Aka Recursive Resolver, Cache etc
Used by endsystems (stub resolvers) to query (resolve)
arbitrary domain names
Recursive Resolver is
prepopulated with . (root)
root DNS server
addresses
www.upenn.edu
3 .edu
referral to .edu
2
recursive 4
5
resolver referral to upenn.edu
6
www.upenn.edu upenn.edu
1 8
answer 1.2.3.4
7
endstation
(uses DNS stub resolver)
Back to DNSSEC
DNSSEC at a glance
Each zone has a public and private key pair
The zone owner uses the private key to sign the zone data,
producing digital signatures for each resource record set
Public key is published in the zone itself so that resolvers can find it
Zone public keys are organized in a chain of trust following the
normal DNS delegation path
DS Delegation Signer
(certifies public key for subordinate zone)
Recursive Resolver is
prepopulated with . (root)
root DNS server
addresses
www.upenn.edu
3 .edu
referral to .edu
2
recursive 4
5
resolver referral to upenn.edu
6
www.upenn.edu upenn.edu
1 8
answer 1.2.3.4
7
endstation
(uses DNS stub resolver)
Recursive Resolver is
prepopulated with
root DNS server
. (root) roots pubkey
addresses and the
roots public key
www.upenn.edu 3 .edu
set DO bit referral to .edu edu pubkey
2 + DS, RRSIG
recursive 4
5
resolver referral to upenn.edu
(has roots pubkey) + DS, RRSIG
6
www.upenn.edu upenn.edu
1 8 upenn pubkey
answer answer 1.2.3.4
+ AD bit + RRSIG
7
endstation
(uses DNS stub resolver) (Also queries for DNSKEY
and DS records as needed)
EDNS0
DNS messages larger than 512 bytes requires:
Use of TCP (typically truncated UDP response followed by TCP retry)
EDNS0 - a DNS extension mechanism allowing negotiation of larger
UDP message buffers
AD - Authenticated Data
CD - Checking Disabled
CD Flag
CD - Checking Disabled
Querier sets CD flag to indicate that pending (non-
authenticated data) is acceptable to it, eg. because it is willing
to do its own cryptographic validation of the signatures.
Question Section
Additional Section
DNS Header
0 08 15
16-bit Query ID
QR OpCode AA TC RD RA Z AD CD RCODE
12-bytes
0 NOERROR No Error
1 FORMERR Format Error
2 SERVFAIL Server Failure
3 NXDOMAIN Not existent domain name
4 NOTIMPL Function not implemented
5 REFUSED Query Refused, usually by policy
Extended RCodes
Extended RCODES do not appear in the DNS header (since there isnt
enough space there). They instead appear in the OPT pseudo RR, which
has a special format designed to accommodate them.
;; QUESTION SECTION:
;jabber.upenn.edu. IN AAAA
;; ANSWER SECTION:
jabber.upenn.edu. 86400 IN AAAA 2001:468:1802:101::805b:2ac
;; AUTHORITY SECTION:
upenn.edu. 86400 IN NS dns2.udel.edu.
upenn.edu. 86400 IN NS noc2.dccs.upenn.edu.
upenn.edu. 86400 IN NS noc3.dccs.upenn.edu.
upenn.edu. 86400 IN NS dns1.udel.edu.
;; ADDITIONAL SECTION:
noc2.dccs.upenn.edu. 86400 IN A 128.91.254.1
noc2.dccs.upenn.edu. 86400 IN AAAA 2001:468:1802:102::805b:fe01
noc3.dccs.upenn.edu. 86400 IN A 128.91.251.158
dns1.udel.edu. 86400 IN A 128.175.13.16
dns2.udel.edu. 86400 IN A 128.175.13.17
Authenticated Data
$ dig jabber.upenn.edu AAAA +dnssec
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 690
;; flags: qr aa rd ad; QUERY: 1, ANSWER: 2, AUTHORITY: 5, ADDITIONAL: 7
Answer &
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 4096 Signature
;; QUESTION SECTION: DNSSEC Ok
;jabber.upenn.edu. IN AAAA
;; ANSWER SECTION:
jabber.upenn.edu. 86400 IN AAAA 2001:468:1802:101::805b:2ac
jabber.upenn.edu. 86400 IN RRSIG AAAA 5 3 86400 20090719232941 (
20090619232159 23382 upenn.edu.
26bOACMMoojfX/zVW1AfhWZ/LSuvn5Fo8iHxVqV/NBzT
JJb0LitaOQVqKCxxswH0TDQgmQiayaL6xGk0yfHo7T32
i1pEFbJdkbNvd4M7GQktB22lBY12Uzrd+/FmAA2xqJ2P
ZDBNbIjkd41oRD098BAmYfGGGDdb8Dyectx8L/Q= )
;; AUTHORITY SECTION:
upenn.edu. 86400 IN NS dns1.udel.edu.
upenn.edu. 86400 IN NS noc3.dccs.upenn.edu.
upenn.edu. 86400 IN NS dns2.udel.edu.
upenn.edu. 86400 IN NS noc2.dccs.upenn.edu.
upenn.edu. 86400 IN RRSIG NS 5 2 86400 20090719232217 (
20090619223616 23382 upenn.edu.
WWpT4uD9p5zORM+2O7pRZ46+Qo3cHj9tnjxH62Xt9QBR
yu9V7+3ihlIM1HCd9kjsddskT8GJ+5hEzykB8fPIjSli
bqG6hCnCccGdTsGzmPoGdlz95H7Nf2yfrlGLAcSCix6I
EJb8Aj4+OW9Zq1dmeZrnJDXSzm8joQg5+IlkzR4= )
Record #Labels Original
RRSIG
Type Algorithm (minus root) TTL
Covered
Signature
Expiration
(YYYYMMDDHHmmSS)
;; ANSWER SECTION:
26bOACMMoojfX/zVW1AfhWZ/LSuvn5Fo8iHxVqV/NBzT
JJb0LitaOQVqKCxxswH0TDQgmQiayaL6xGk0yfHo7T32
Signature i1pEFbJdkbNvd4M7GQktB22lBY12Uzrd+/FmAA2xqJ2P
Inception ZDBNbIjkd41oRD098BAmYfGGGDdb8Dyectx8L/Q= )
(YYYYMMDDHHmmSS)
Key Tag
Cryptographic Signature
DNSKEY record
Contains zones DNSSEC public key and associated flags
Flags (16 bits) Protocol
Bit 7: zone flag Must be 3
Algorithm
Bit 1: SEP flag (DNSSEC)
Bit 8: Revoke
Public Key
Zone Name (Base 64 encoded)
http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xml
flags proto
algorithm
$ dig upenn.edu DNSKEY
;; ANSWER SECTION:
upenn.edu. 7200 IN DNSKEY 256 3 5 (
AwEAAcDt107stSjvoBA/YVPr+2gvB3v33tXr7ROZ/Jqm
WtNLraxQPzgXM1AhwjtdEqwCAnk01V7+Fw7K94sh6jpI
5bFofS7MGtd0VvNyq52bgRnusgbm1ME2Lx9+o3fy9ppv
7C6bahGrV3aiq9wNVPj/ccJn5AnZCOsi3grVsj6izCYH
) ; key id = 46752
upenn.edu. 7200 IN DNSKEY 256 3 5 (
AwEAAfAHsS33kJEImVk09yFJY5hXumAo+JVVJMJpJUaj
l/rh0fFkdikS2oatVvxHHHqKN9Kg3DoKQss/CzCZa4zn
KlqYGvSl7RefKR3QLyPBGQN2aOUWxshDgOWLmOtqNpmP
+6Drfn8LJVTOjuwmU80laQcdA/AoOGVPE3zP16G/F+qp
) ; key id = 43248
upenn.edu. 7200 IN DNSKEY 257 3 5 (
AwEAAek95gyBF2nurdIE2Q63VVcMlazOlQEnz0N4Ce89
SB4Juw2eEBerLmEanuGJbrs0oGx3SKCMyhOYL9q1ZrmC
NCf6PnACwv88NtrYOjHAOmOlLAvKAQv8MTBbEwTWBBw5
K8jUwzcaGyDjo3U+Hai+ow8Tiev0By+hrcT4DegsbEB8
MEQIgEUO/Kw9wbJLEdpvVXtuV2l78G75FUwmrA8jzEka
M7bKg/HSTIMupbwfs4IHYgbG/PkqOZYL3uxm9gncVjbh
4YYd4OG6koVoWteWTS8JdYq4gr9b9AEjhwAzbe7bd7pX
+qD70CCbh0jSOVhPvhRpCHIYZAJIwEAWs711HHM=
) ; key id = 29242
Canonical Order
Sort DNS names in order of most significant (rightmost)
labels first. Then within each label, sort them as octet
strings, case-folding ASCII letters to lowercase.
example.com
a.example.com
blah.a.example.com
Z.a.example.com
zABC.a.EXAMPLE.com
z.example.com
\001.z.example.com
*.z.example.com
\200.z.example.com
NSEC record
Next Secure record
Describes interval between consecutive names in a zone
Type-bitmap defines RRtypes available at owner
Side Effect: allows enumeration of zone contents
a.example.com. 300 IN NSEC d.example.com. A MX RRSIG NSEC
Owner Name SOA min TTL Next Owner Name Type Bitmap
(List of Types defined
at Owner Name)
*.upenn.edu would
have been between
$ dig +dnssec +multi bozo.upenn.edu A upenn.edu and
_kerberos.upenn.edu
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 7708
;; ;; AUTHORITY SECTION:
upenn.edu.! ! 3600 IN! NSEC _kerberos.upenn.edu. NS SOA MX RRSIG NSEC DNSKEY TYPE65534
upenn.edu.! ! 3600 IN! RRSIG NSEC 5 2 3600 (
! ! ! ! 20120508051318 20120408042226 50475 upenn.edu.
! ! ! ! ZzTYjeHECy5xLo+wrXq1VwmtNI3Wz7cpNLBdg+3xM9ph
! ! ! ! H9jOndAViCKwsDa4uLBYBcKss9qbbYjVtMp5w0lmVpwm
! ! ! ! cwxYheAyEN+w2VPBhLZ9qjfib8Q6Lfi3r3lC8EDJciL0
! ! ! ! 1LSQwP2gyFx7V6VG08z11W6fuB6A/6/3/55xwW0= )
cagrid.bmif.upenn.edu.! 3600 IN! NSEC BRYNMAWR-GW.upenn.edu. CNAME RRSIG NSEC
cagrid.bmif.upenn.edu.! 3600 IN! RRSIG NSEC 5 4 3600 (
! ! ! ! 20120507190845 20120407181400 50475 upenn.edu.
! ! ! ! yn4Au0Q4EViYu0LonWlWviTUn6kLYfyMMERajl2Jdaob
! ! ! ! CYLfwnWMrXYPh6IZu03dYSkIRg7WEoyEGckk5J5Gudok
! ! ! ! ikdFEEuuBjV4cdUCMp67lvUjCGVclFWnKhb5ni/FmieH
! ! ! ! q7yFeztBt/IsKxtbcFSX0Isjt5mtNqt5is+UNpY= )
bozo.upenn.edu would
have been between
cagrid.bmif.upenn.edu &
brynmawr-gw.upenn.edu
NOERROR (nodata) responses can be authenticated with one signed NSEC record,
which just reports all available RRTYPEs at that name
;; AUTHORITY SECTION:
upenn.edu.! ! 3600 IN! NSEC _kerberos.upenn.edu. NS SOA MX RRSIG NSEC DNSKEY TYPE65534
upenn.edu.! ! 3600 IN! RRSIG NSEC 5 2 3600 (
! ! ! ! 20120508051318 20120408042226 50475 upenn.edu.
! ! ! ! ZzTYjeHECy5xLo+wrXq1VwmtNI3Wz7cpNLBdg+3xM9ph
! ! ! ! H9jOndAViCKwsDa4uLBYBcKss9qbbYjVtMp5w0lmVpwm
! ! ! ! cwxYheAyEN+w2VPBhLZ9qjfib8Q6Lfi3r3lC8EDJciL0
! ! ! ! 1LSQwP2gyFx7V6VG08z11W6fuB6A/6/3/55xwW0= )
NSEC3 record
New version of NSEC that provides defense against zone
enumeration (see RFC 5155 for details)
N3O3HKFAKV0FDU4OMHFEHT0FROFG6RQL.example.com. 3600 IN
NSEC3 1 0 5 9EBA4228 Q9T0VRM5S6EEF2N72RPCC5ENOF4IGV3O A
MX RRSIG
nsec3 params
next hashed owner
hashalg, flags, iterations, salt
NSEC3PARAM record
NSEC3PARAM record at zone apex also holds the
parameters
(Example taken from RFC 5155 Appendix B. Consult for details) covers next closer name
Question: a.c.x.w.example. IN A
;; AUTHORITY SECTION:
0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. NSEC3 1 1 12 aabbccdd (
2t7b4g4vsa5smi47k61mv5bv1a22bojr MX DNSKEY NS
SOA NSEC3PARAM RRSIG )
0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example. RRSIG NSEC3 7 2 3600 (
20150420235959 20051021000000 40430 example.
OSgWSm26B+cS+dDL8b5QrWr/dEWhtCsKlwKL
IBHYH6blRxK9rC0bMJPwQ4mLIuw85H2EY762 matches closest encloser
BOCXJZMnpuwhpA== )
NOERROR (nodata) responses can be authenticated with one signed NSEC record,
which just reports all available RRTYPEs at that name (for qtype != DS)
In the example below blah.huque.com exists (TXT) but not for the MX record type.
;; AUTHORITY SECTION:
Hash of blah.huque.com.
Next hashed name Type bitmap
Secure Delegations
dnskey algorithm
keytag
hash algorithms
1 - SHA-1 Signature of DS record set
2 - SHA256
A DS record in a parent zone refers to a specific DNSKEY record in a child zone
Parent unsigned?
Common invocations:
dig <qname>
dig <qname> <qtype>
dig @server <qname> <qtype>
dig -x <ipaddress>
dig +trace <qname> <qtype>
General advice
Summary of steps
options {
[...]
dnssec-enable yes;
dnssec-validation auto;
dnssec-lookaside auto;
[...]
};
Validating Resolver
# named.conf Validating recursive resolver example
acl trusted {
192.0.2.0/24; # my clients IPv4 address block
2001:db8:f470::/48; # my clients IPv6 address block
}
zone "." {
type hint;
file "named.root";
};
root nameserver addresses. latest version at
www.internic.net/domain/named.root
Generating keys
Generating Keys:
dnssec-keygen <zone>
dnssec-keygen -f KSK <zone> # KSK generation
dnssec-keygen -3 <zone> # NSEC3 compat alg
Creates files:
K<zone>+mmm+nnnn.key and
K<zone>+mmm +nnnn.private
Signing zones
options {
[...]
dnssec-enable yes;
[...]
};
Authoritative Server
The master (primary master) authoritative server should define an access
control list to limit the servers (usually only its slave servers) which can
perform zone transfers of the DNS database. Note however, that this is a
policy decision. Some folks allow anyone to transfer the contents of their
zone.
options {
[...]
allow-transfer {
transferlist;
};
[...]
};
options {
[ ... various options ...];
recursion no; if authoritative only
};
zone "example.com" {
type master; on master server
file "zone.example.com";
};
zone "example.com" {
type slave; on slave server
file "zone.example.com";
masters { 10.2.2.2; };
};
File: zonetransfer.key:
key "slave1.example.com." {
algorithm "hmac-md5";
secret "xjlsjdlfdfhfhdfldfljdflsjdljsdlfjdlkf=";
};
File: named.conf:
include "/usr/local/bind/zonetransfer.key"
zone example.com {
type slave;
masters { 10.12.7.26 key slave1.example.com.; };
[...]
};
server 10.12.7.26 {
keys { slave1.example.com.; };
};
Accurate time
zone "example.com" {
type master;
update-policy local;
auto-dnssec maintain;
file "zones/example.com/zonefile";
key-directory "zones/example.com";
};
$ nsupdate -l
ttl 86400
zone example.com.
update add ldap.example.com. A 10.4.4.4
send
^D
$
Other methods
Newest versions of BIND have some other ways that might make it
easier to deploy DNSSEC in some environments where its not easy
to modify the master server ...
Key Rollover
Conventional wisdom is that DNSSEC keys should be changed
(rolled over) at regular intervals. However, not everyone agrees,
including some noted security experts
Some argue routine key rollover instills practice & confidence that
youll be able to do it properly when you really need to. However,
do we do this for other applications (Kerberos, PKI/CAs, SSL)?
KSKs are rolled less frequently (typically once per year or less). This
does require co-ordinating with the parent zone to sign and install
new DS records for the KSKs.
Key Rollover
ZSK: Pre-publish
Re-signing Records
Amplification Attacks
http://blog.huque.com/2013/04/dns-amplification-attacks.html
Look at Response Rate Limiting and other countermeasures
http://www.redbarn.org/dns/ratelimits
www.upenn.edu 3 .edu
set DO bit referral to .edu edu pubkey
2 + DS, RRSIG
recursive 4
5
resolver referral to upenn.edu
(has roots pubkey) + DS, RRSIG
6
www.upenn.edu upenn.edu
1 8 upenn pubkey
answer 1.2.3.4
+ RRSIG
7
endstation Stub to Recursive
(uses DNS stub resolver) Resolver channel
[DNSSEC Tutorial, USENIX LISA 13]
102
Channel Security
For stub channel security, simple symmetric key TSIG wont work
Cant distribute same TSIG key to many clients, because that allows
any of them to forge answers to all others
DNSCurve
http://dnscurve.org/
Some people think this is a competitor to DNSSEC, but it really isnt
Encrypts/authenticates packets between resolvers and authoritative
servers
But, we may need transport security as well (we live in the PRISM
world of mass surveillance now!)
Zone/validation testers
DNSSEC Trigger
http://nlnetlabs.nl/projects/dnssec-trigger/
Local resolver hack; probe for DNSSEC capable servers and
instruct local resolver to use/validate
Zone maintenance
3rd party tools that some folks use to deploy/manage DNSSEC with
BIND (mostly everything can be done in BIND itself these days):
OpenDNSSEC
zkt
http://www.dnssec-tools.org/
Microsoft DNSSEC deployment guide
http://www.microsoft.com/en-us/download/details.aspx?id=15204
grodd.magpi.net.!86400!IN!SSHFP!(1 1
F60AE0994C0B02545D444F7996088E9EA7359CBA)
fingerprint
IPSECKEY record
RFC 4025: method for storing IPSEC keying material in DNS
rdata format: precedence, gateway-type, algorithm, gateway
address, public key (base64 encoded)
Most are incapable of issuing certs with any but the most basic
capabilities (eg. alternate name forms or other extensions)
http://tools.ietf.org/html/rfc6698
Use DNSSEC for better & more secure ways to authenticate SSL/
TLS certificates:
_443._tcp.www.example.com. IN TLSA (
0 0 1 d2abde240d7cd3ee6b4b28c54df034b9
7983a1d16e8a410e4561cb106618e971 )
usage
selector matching
type certificate association data
Selector field:
0 Match full certificate
1 Match only SubjectPublicKeyInfo
_443._tcp.www.example.com. IN TLSA (
1 1 2 92003ba34942dc74152e2f2c408d29ec
a5a520e7f2e06bb944f4dca346baf63c
1b177615d466f6c4b71c216a50292bd5
8c9ebdd2f74e38fe51ffd48c43326cbc )
;; ANSWER SECTION:
_443._tcp.www.huque.com. 7200 IN TLSA 3 0 1 (
! ! ! ! 7EF4BD014E9A4F302FC1EE74FB2D29718C5B0F4CB23B
! ! ! ! 25B267A1D92F0410890B )
;; ANSWER SECTION:
_25._tcp.nlnetlabs.nl.! 10200 IN CNAME
3.1.1._dane.nlnetlabs.nl.
_25._tcp.nlnetlabs.nl.! 10200 IN RRSIG CNAME 8 4 10200 (
! ! ! ! 20130529005004 20130501005004 42393 nlnetlabs.nl.
! ! ! ! SNKS6Bo8SsqRxDuxF9dRiwqom4YqOArpLAWjv1WHf5fr
! ! ! ! aURdyssZ3V/R8jBRwMNhQNqIQVlDc4i84OsBs2Vpolil
! ! ! ! j0Gy5mfqgnxRCh5b6TtLDE5t4lcFg0k5FgaqtLXCd0an
! ! ! ! f8zdv8nQM/9UOaXgnQLXuUDv4ZpDPXkxPuokKIE= )
3.1.1._dane.nlnetlabs.nl. 10200!IN TLSA! 3 1 1 (
! ! ! ! 0D1FCBD71686199607A132744A4918FC209565C91FA8
! ! ! ! E9FFEEA0AAFD6B9305F6 )
3.1.1._dane.nlnetlabs.nl. 10200!IN RRSIG TLSA 8 6 10200 (
! ! ! ! 20130529005004 20130501005004 42393 nlnetlabs.nl.
! ! ! ! mE8cSI5wCbx4lsQTHoWZTweh1Jo+A0ZDETnNDGKJvafL
! ! ! ! 2Q7cMhoqq9J5mvaKFm1MN8qgiaRbt56c9OcahFA3xkO3
! ! ! ! loDljLlcUlXpVoRDzWe73MjjyuU76UrsyqNdxmHKB6xR
! ! ! ! mEFxkvcQ5EM6b1fDGRHOfnMFVl5ezi9GwkB7DcI= )
Registrar support
Note: not all TLD registrars support DNSSEC yet (ie. ability to
install a DS record in the TLD)
http://validator-search.verisignlabs.com/
http://www.potaroo.net/ispcol/2012-10/counting-dnssec.html
http://www.iepg.org/2013-07-ietf87/2013-07-28-dnssec.pdf
Deployed validators
Heard at ICANN45 (Oct 2012): US gov now requiring DNSSEC
validation in all systems operated in that space
A"en%on'Tutorial'A"endees!'
Please'dont'forget'to'll'out'your'Tutorial'Surveys.'
Your%feedback%is%very%important%to%us%%
and%helps%us%shape%the%future%%
of%the%LISA%training%program.%%
Please%visit%www.usenix.org/lisa13/training/survey%
and%ll%out%the%appropriate%surveys.%%
Thanks%for%your%help!'
Thank you!
@shuque
Shumon Huque
shuque -@- upenn.edu
DNS
Domain Name System
Base specs in RFC 1034 & 1035 (obs 882 & 883)
Distributed global database
Indexed by domain names (together with a type and class)
A domain name is a sequence of labels, eg.
www.amazon.com.
Domain Names are case insensitive, but case preserving
Transport protocol: UDP and TCP port 53
[DNSSEC Tutorial, USENIX LISA 13]
134
DNS
. root Zone
91.130.in-addr.arpa
91
[DNSSEC Tutorial, USENIX LISA 13]
Zone
136
Root and TLDs
Root of the DNS (empty label)
Next level of names are called Top Level Domains (TLDs)
Until recently 3 primary classes of TLDs
GTLD: Generic Top Level Domains (.com, .net, .edu, .org etc)
CCTLD: Country Code TLD (2 letter codes for each country,
eg. .us, .fr, .jp, .de, ...)
Server Side:
Authoritative Servers
Resolvers (Recursive Resolvers)
Client Side:
Stub resolvers (usually on DNS client machines)
Resolver
Aka Recursive Resolver, Cache etc
Used by endsystems (stub resolvers) to query (resolve)
arbitrary domain names
$ cat /etc/resolv.conf
www.upenn.edu
3 .edu
referral to .edu
2
recursive 4
5
resolver referral to upenn.edu
6
www.upenn.edu upenn.edu
1 8
answer 1.2.3.4
7
endstation
(uses DNS stub resolver)
SOA record
Defines the start of a new zone; and important parameters for the
zone
A record
CNAME record
An alias, ie. maps one name to another (regardless of type)
Put another way, this is another name for this name
rdata contains the mapped domain name (canonical name)
CNAME records have special rules
$ dig www.sas.upenn.edu A
;; QUESTION SECTION:
;www.sas.upenn.edu.!! IN! A
;; ANSWER SECTION:
www.sas.upenn.edu.! 300! IN! CNAME! virgo.sas.upenn.edu.
virgo.sas.upenn.edu.! 900! IN! A! 128.91.55.21
host1.example.com. IN A 192.0.2.17
IPv6 addresses
2001:0db8:3902:00c2:0000:0000:0000:fe04
2001:0db8:3902:00c2:0000:0000:0000:fe04
2001:db8:3902:c2::fe04
4.0.e.f.0.0.0.0.0.0.0.0.0.0.0.0.2.b.7.0.2.0.9.3.8.b.d.
0.1.0.0.2 (make DNS labels)
4.0.e.f.0.0.0.0.0.0.0.0.0.0.0.0.2.b.7.0.2.0.9.3.8.b.d.
0.1.0.0.2.ip6.arpa. (append ip6.arpa.)
4.0.e.f.0.0.0.0.0.0.0.0.0.0.0.0.2.b.7.0.2.0.9.3.8.b.d.
0.1.0.0.2.ip6.arpa. IN PTR host1.example.com.
MX record
Mail Exchanger: defines the host receiving mail
rdata consists of a preference field and the hostname of the
mail receiver
SRV record
service name transport priority weight port server name
NAPTR record
Naming Authority Pointer Record (RFC 3403 - DDDS)
Very complex record, and induces additional complex
processing on resolver (lookup and rewrite)
Size restrictions
Label: 63 octets max
Domain Name: 255 octets max
TTL: positive signed 32-bit integer
Entire DNS message: 512 bytes (UDP) - plain DNS
Messages larger than 512 bytes requires:
Use of TCP (often truncated UDP response followed by TCP retry)
EDNS0 - a DNS extension mechanism allowing negotiation of larger
UDP message buffers
(hex) 03777777057570656e6e0365647500
4 Component labels:
www 0x 03 77 77 77
upenn 0x 05 75 70 65 6e 6e
edu 0x 03 65 64 75
. 0x 00
Question Section
Answer Section
Authority Section
Additional Section
16-bit Query ID
QR OpCode AA TC RD RA R AD CD RCODE
12-bytes
DNS Header
QR: set to 1 in DNS response messages
OpCode:
0 Standard Query
1 Inverse Query (deprecated)
2 Status request (undefined and unused?)
4 Notify
5 Update
3,6-15 Undefined
Extended RCodes
Extended RCODES do not appear in the DNS header (since there isnt
enough space there). They instead appear in the OPT pseudo RR, which
has a special format designed to accommodate them.
NAME
(variable length, upto 255 octets)
RDATA
(variable length)
2. NOTIFY messages
master
1. Dynamic Update
3.SOA Query/Response
4. IXFR Request/Response
master
Zone Delegation
Example of delegation of google.com in .com zone:
91.130.in-addr.arpa
91
[DNSSEC Tutorial, USENIX LISA 13]
Zone
191