247
Issue Date: Revision: DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4

DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

  • Upload
    others

  • View
    31

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Issue Date:

Revision:

DNS / DNSSEC

Workshop

Generic slides

03 November 2015

2.0-draft4

Page 2: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS

• Troubleshooting

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions (DNSSec)

• DNSSec Key Management and Automation

2

Page 3: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS

• Troubleshooting

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions (DNSSec)

• DNSSec Key Management and Automation

3

Page 4: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Domain Name System

• A lookup mechanism for translating objects into other

objects

– Mapping names to numbers and vice versa

• A globally distributed, loosely coherent, scalable, reliable,

dynamic database

• Comprised of three components

– A “name space”

– Servers making that name space available

– Resolvers (clients) query the servers about the name space

• A critical piece of the Internet infrastructure

4

Page 5: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

IP Addresses vs Domain Names

The Internet

2001:0C00:8888::My Computer www.apnic.net2001:0400::

www.apnic.net202.112.0.46

2001:0400::

DNS

5

Page 6: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

This feature still exists:

[Unix] /etc/hosts

[Windows] c:\windows\hosts

Old Solution: hosts.txt

• A centrally-maintained file, distributed to all hosts on the

Internet

• Issues with having just one file

– Becomes huge after some time

– Needs frequent copying to ALL hosts

– Consistency

– Always out-of-date

– Name uniqueness

– Single point of administration

// hosts.txt

SERVER1 128.4.13.9

WEBMAIL 4.98.133.7

FTPHOST 200.10.194.33

6

Page 7: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Features

• Global distribution

– Shares the load and administration

• Loose Coherency

– Geographically distributed, but still coherent

• Scalability

– can add DNS servers without affecting the entire DNS

• Reliability

• Dynamicity

– Modify and update data dynamically

7

Page 8: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Features

• DNS is a client-server application

• Requests and responses are normally sent in UDP packets,

port 53

• Occasionally uses TCP, port 53

– for very large requests, e.g. zone transfer from master to slave

8

Page 9: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Root.

.org .net .com .au

.edu.au

example.edu.au

.gov

.jp

.tv

.inx.y.z.a

www.example.edu.au

a.b.c.d

e.f.g.h

i.j.k.l

m.n.o.pw.x.y.z.

p.q.r.s

“Ask a.b.c.d”

“Ask e.f.g.h”

“Ask i.j.k.l”

“Go to m.n.o.p”

localdns

www.example.edu.au?“go to

m.n.o.p”

www.example.edu.au?

www.example.edu.au?

www.example.edu.au?

www.example.edu.au?

Querying the DNS – It’s all about IP!

9

Page 10: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

The DNS Tree HierarchyRoot.

net jporg com arpa au

whois

edu

bnu

iana

www www

www wasabi

ws1 ws2

edu comnet

abc

www

apnic

gu

www

FQDN = Fully Qualified Domain Name

10

Page 11: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Domains

• Domains are “namespaces”

• Everything below .com is in the com domain

• Everything below apnic.net is in the apnic.net domain and

in the net domain

11

Page 12: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

NET Domain

APNIC.NET

Domain

AU Domain

www.def.edu.au?

Root.

net org com arpa au

whois

iana

wwwwww wasabi

ws1 ws2

edu comnet

abc

www

apnic

def

www

Domains

12

Page 13: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Delegation

• Administrators can create subdomains to group hosts

– According to geography, organizational affiliation or any other

criterion

• An administrator of a domain can delegate responsibility for

managing a subdomain to someone else

– But this isn’t required

• The parent domain retains links to the delegated

subdomain

– The parent domain “remembers” to whom the subdomain is

delegated

13

Page 14: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Zones and Delegations

• Zones are “administrative spaces”

• Zone administrators are responsible for a portion of a

domain’s name space

• Authority is delegated from parent to child

14

Page 15: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

NET Domain

APNIC.NET

Domain

NET Zone

TRAINING.APNIC.NET Zone APNIC.NET Zone doesn’t

include TRAINING.APNIC.NET

since it has been “delegated”

APNIC.NET Zone

Root.

netorg com arpa

whois

iana

wwwwww training

ns1 ns2

apnic

Zones

15

Page 16: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Name Servers

• Name servers answer ‘DNS’ questions

• Several types of name servers

– Authoritative servers

• master (primary)

• slave (secondary)

– Caching or recursive servers

• also caching forwarders

• Mixture of functions

Primary

Secondary

16

Page 17: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Root Servers

• The top of the DNS hierarchy

• There are 13 root name servers operated around the world– [a-m].root-servers.net

• There are more than 13 physical root name servers

– Each rootserver has an instance deployed via anycast

17

Page 18: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Root Servers

18

http://root-servers.org/

Page 19: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Root Server Deployment at APNIC

• Started in 2002, APNIC is committed to establish new root

server sites in the AP region

• APNIC assists in the deployment providing technical

support.

• Deployments of F, K and I-root servers in

– Singapore, Hong Kong, China, Korea, Thailand, Malaysia, Indonesia,

Philippines, Fiji, Pakistan, Bangladesh, Taiwan, Cambodia, Bhutan,

and Mongolia

19

Page 20: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Resolver

• Or “stub” resolver

• A piece of software (usually in the operating system) which

formats the DNS request into UDP packets

• A stub resolver is a minimal resolver that forwards all

requests to a local recursive nameserver

– The IP address of the local DNS server is configured in the resolver.

• Every host needs a resolver

– In Linux, it uses /etc/resolv.conf

• It is always a good idea to configure more than one

nameserver

20

Page 21: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Recursive Nameserver

• The job of the recursive nameserver is to locate the

authoritative nameserver and get back the answer

• This process is iterative – starts at the root

• Recursive servers are also usually caching servers

• Prefer a nearby cache

– Minimizes latency issues

– Also reduces traffic on your external links

• Must have permission to use it

– Your ISP’s nameserver or your own

Recursive/Caching

Nameserver

21

Page 22: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Authoritative Nameserver

• A nameserver that is authorised to provide an answer for a particular domain– Can be more than one auth nameserver

• Two types based on management method:– Primary (Master) and Secondary (Slave)

• Only one primary nameserver– All changes to the zone are done in the primary

• Secondary nameserver/s will retrieve a copy of the zonefilefrom the primary server– Slaves poll the master periodically

• Primary server can “notify” the slaves

Primary

Secondary

Secondary

22

Page 23: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Resource Records

• Entries in the DNS zone file

• Components:

Resource Record Function

Label Name substitution for FQDN

TTL Timing parameter, an expiration limit

Class IN for Internet, CH for Chaos

Type RR Type (A, AAAA, MX, PTR) for

different purposes

RDATA Anything after the Type identifier;

Additional data

23

Page 24: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Common Resource Record TypesRR Type Name Functions

A Address record Maps domain name to IP addresswww.example.com. IN A 192.168.1.1

AAAA IPv6 address record Maps domain name to an IPv6 addresswww.example.com. IN AAAA 2001:db8::1

NS Name server record Used for delegating zone to a nameserverexample.com. IN NS ns1.example.com.

PTR Pointer record Maps an IP address to a domain name1.1.168.192.in-addr.arpa. IN PTR

www.example.com.

CNAME Canonical name Maps an alias to a hostnameweb IN CNAME www.example.com.

MX Mail Exchanger Defines where to deliver mail for user @

domainexample.com. IN MX 10 mail01.example.com.

IN MX 20 mail02.example.com.

24

Page 25: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Example: RRs in a zone file

apnic.net. 7200 IN SOA ns.apnic.net. admin.apnic.net. (

2015050501 ; Serial

12h ; Refresh 12 hours

4h ; Retry 4 hours

4d ; Expire 4 days

2h ; Negative cache 2 hours )

apnic.net. 7200 IN NS ns.apnic.net.

apnic.net. 7200 IN NS ns.ripe.net.

www.apnic.net. 3600 IN A 192.168.0.2

www.apnic.net 3600 IN AAAA 2001:DB8::2

Label TTL Class Type Rdata

25

Page 26: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Places where DNS data lives

Changes do not propagate instantly

Registry DB

Master

Slave server

Slave

Cache server

Not going to net if TTL>0

Might take up to ‘refresh’

to get data from master

Upload of zone

data is local policy

26

Page 27: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Delegating a Zone

• Delegation is passing of authority for a subdomain to

another party

• Delegation is done by adding NS records

– Ex: if APNIC.NET wants to delegate TRAINING.APNIC.NET

training.apnic.net. NS ns1.training.apnic.net.

training.apnic.net. NS ns2.training.apnic.net.

• Now how can we go to ns1 and ns2?

– We must add a Glue Record

27

Page 28: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Only this record needs glue

Glue Record

• Glue is a ‘non-authoritative’ data

• Don’t include glue for servers that are not in the sub zones

training.apnic.net. NS ns1.training.apnic.net.

training.apnic.net. NS ns2.training.apnic.net.

training.apnic.net. NS ns2.example.net.

training.apnic.net. NS ns1.example.net.

ns1.training.apnic.net. A 10.0.0.1

ns2.training.apnic.net. A 10.0.0.2

Glue

Record

28

Page 29: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Delegating training.apnic.net. from

apnic.net.

ns.training.apnic.net

1. Setup minimum two servers

2. Create zone file with NS records

3. Add all training.apnic.net data

ns.apnic.net

1. Add NS records and glue

2. Make sure there is no other data

from the training.apnic.net. zone in

the zone file

29

Page 30: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Remember ...

• Deploy multiple authoritative servers to distribute load and

risk

– Put your name servers apart from each other

• Use cache to reduce load to authoritative servers and

response times

• SOA timers and TTL need to be tuned to the needs of the

zone

– For stable data, use higher numbers

30

Page 31: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Performance of DNS

• Server hardware requirements

• OS and the DNS server running

• How many DNS servers?

• How many zones are expected to load?

• How large are the zones?

• Zone transfers

• Where are the DNS servers located?

• Bandwidth

31

Page 32: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Performance of DNS

• Are these servers Multihomed?

• How many interfaces are to be enabled for listening?

• How many queries are expected to receive?

• Recursion

• Dynamic updates

• DNS notifications

32

Page 33: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

33

Page 34: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS

• Troubleshooting

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions (DNSSec)

• DNSSec Key Management and

Automation

34

Page 35: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Software

• DNS BIND – authoritative + recursive server

• Unbound - caching DNS resolver

• NSD – authoritative only nameserver

• Microsoft DNS – provided with the Windows Server

• Knot DNS – authoritative only nameserver

• PowerDNS – data storage backends

35

Page 36: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

BIND

• Berkeley Internet Name Domain

• The most widely-used open source DNS software on the

Internet

– Current version is Bind 9.10.3

– Bind 9.9.8 is also current with Extended Support

– Bind 9.8.x EOL as of Sep 2014

• Maintained by the Internet Systems Consortium (ISC)

• Bind 10 is in development

– New architecture

– Bind 10.1.1 released on June 06 2013

– Has been concluded and renamed as Bundy (http://bundy-dns.de/)

36

Page 37: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Where to Get BIND

• Download source from the ISC website

– http://www.isc.org

– ftp://ftp.isc.org/isc/bind9

• Install from your distribution’s package manager

• Some packages may also be required

– OpenSSL is a necessary for DNSSEC

37

Page 38: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Unpacking BIND9

• When installing BIND from source, decompress the gzip filetar xvfz bind-9.<version>.tar.gz

cd bind-9.<version>

• What's in there?

– A lot of stuff (dig, libraries, etc)

– Configure scripts

– Administrator's Reference Manual (ARM)

38

Page 39: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Building BIND9 from Source

• must be in the BIND 9 directory

• Determine the appropriate includes and compiler settings

./configure --with-openssl

• Build and compile

make

• Install the BIND package

make install

• Verify the installation

which named

named -v

39

Page 40: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Building BIND9 with Package

Manager

• Redhat/CentOS

yum –y install bind9

• Ubuntu / Debian

apt-get install bind9

40

Page 41: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Location of Executables

/usr/local/sbin

– named

– dnssec-keygen, dnssec-makekeyset, dnssec-signkey, dnssec-

signzone

– lwresd, named-checkconf, named-checkzone

– rndc, rndc-confgen

/usr/local/bin

– dig

– host, isc-config.sh, nslookup

– Nsupdate

41

Page 42: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Named Configuration

• The BIND configuration file is called “named.conf”

– Default location is in /etc/named.conf

– Run named with –c option to specify a different location

• Defines the zones and points to the corresponding zonefile

• Defines global options

• Logging can be turned on for troubleshooting

42

Page 43: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Named Configuration

• BIND Configuration file

• Options statement contains all global configuration options to be used as defaults by named.

options {

directory “/var/named/recursive”; };

• Zone statement defines the zones and any zone-specific option

zone “myzone.net” {

type master;

file “db.myzone.net”; };

43

Page 44: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Root Hints

• Pointer to the root servers

• Root hints file come in many names

– db.cache, named.root, named.cache, named.ca

• Get it from ftp://ftp.rs.internic.net/domain/

• Defined as follows in the config file

zone “.” {

type hint;

file “root.hints”; };

44

Page 45: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

What it looks like

. 3600000 IN NS A.ROOT-

SERVERS.NET.

A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4

A.ROOT-SERVERS.NET. 3600000 AAAA

2001:503:BA3E::2:30

; operated by WIDE

. 3600000 NS M.ROOT-

SERVERS.NET.

M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33

M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35

ftp://ftp.rs.internic.net/domain/

45

Page 46: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Configuring Recursive Server

• The recursive server needs to know how to reach the top of

the DNS hierarchy

• It should also stop some queries such as those for localhost

(127.0.0.1)

• The following files are required to run a recursive/caching

server:

– named.conf

– root.hints

– localhost zone (db.localhost)

– 0.0.127.in-addr.arpa zone (db.127.0.0.1)

– ::1 IPv6 reverse zone (db.ip6)

46

Page 47: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Zones in a Recursive Server

• Loopback name in operating systems– Queries for this shouldn't use recursion

– Configure a file to define the localhost zone

– Localhost will map to 127.0.0.1 and ::1

zone “localhost” {

type master;

file db.localhost; };

• Reverse zone for the loopback– maps 127.0.0.1 (and ::1) to localhost

zone “0.0.127.in-addr.arpa” {

type master;

file db.127.0.0.1;

};

47

Page 48: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Zones in a Recursive Server

• Reverse zone for IPv6 link-local addresszone “8.B.D.0.1.0.0.2.ip6.arpa” {

type master;

file db.2001.db8;

};

• Built-in empty zones will be created for RFC 1918, RFC

4193, RFC 5737 and RFC 6598

48

https://tools.ietf.org/html/rfc6303

Page 49: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Example named.conf

zone "0.0.127.in-addr.arpa." {

type master;

file ”db.127";

};

zone "8.B.D.0.1.0.0.2.ip6.arpa." {

type master;

file ”db.2001.db8";

};

options {

directory "/var/named/recursive";

recursion yes;

};

zone "." {

type hint;

file "named.root";

};

zone "localhost." {

type master;

file "localhost";

};

49

Page 50: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Zone Files

• Contain the resource records defined in a particular zone

• begins with a Start of Authority Record (SOA) @ SOA localhost. root.localhost. (

20150505 ;serial no.

30m ;refresh

15m ;retry

1d ;expire

30m ;negative cache ttl )

• Common Zone File directives– $ORIGIN

– $INCLUDE

– $TTL

– @ represents the current origin

50

Page 51: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Start of Authority (SOA) record

• Serial Number – must be updated if any changes are made in the zone file

• Refresh – how often a secondary will poll the primary server to see if the serial number for the zone has increased

• Retry - If a secondary was unable to contact the primary at the last refresh, wait the retry value before trying again

• Expire - How long a secondary will still treat its copy of the zone data as valid if it can't contact the primary.

• Minimum TTL - The default TTL (time-to-live) for resource records

Domain_name. CLASS SOA hostname.domain.name. mailbox.domain.name (

Serial Number

Refresh

Retry

Expire

Minimum TTL )

51

Page 52: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

TTL Time Values

• The right value depends on your domain

• Recommended time values for TLD (based on RFC 1912)

Refresh 86400 (24h)

Retry 7200 (2h)

Expire 2592000 (30d)

Min TTL 345600 (4d)

• For other servers – optimize the values based on

– Frequency of changes

– Required speed of propagation

– Reachability of the primary server

– (and many others)

52

Page 53: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

localhost zonefile

$TTL 86400

@ IN SOA localhost. root.localhost. (

20150505 ; serial

1800 ; refresh

900 ; retry

69120 ; expire

1080 ; negative ttl

)

NS localhost.

A 127.0.0.1

AAAA ::1

53

Page 54: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

0.0.127.in-addr.arpa zonefile

$TTL 86400

@ IN SOA localhost. root.localhost. (

20150505 ; serial

1800 ;refresh

900 ;retry

69120 ;expire

1080 ;negative ttl

)

NS localhost.

1 PTR localhost.

54

Page 55: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

ip6.arpa zonefile

$TTL 86400

@ IN SOA localhost. root.localhost. (

20150505 ; serial

1800 ;refresh

900 ;retry

69120 ;expire

1080 ;negative ttl

)

NS localhost.

1 PTR localhost.

55

Page 56: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Assembling the files

• Create a directory in /var/named/ and copy the files

# mkdir recursive

# ls

0.0.127.in-addr.arpa db.localhost root.hints

• The directory name and file names will be defined in

named.conf

• Now create a named.conf file in the same directory

56

Page 57: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Running the server

• From the directory

named -g -c named.conf

where:

-c path to the configuration file

-g run in the foreground

57

Page 58: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Testing the server

% dig @127.0.0.1 www.google.com

; <<>> DiG 9.8.3-P1 <<>> www.google.com

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 213

;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:

;www.google.com. IN A

;; ANSWER SECTION:

www.google.com. 156 IN A 74.125.237.115

www.google.com. 156 IN A 74.125.237.113

www.google.com. 156 IN A 74.125.237.116

www.google.com. 156 IN A 74.125.237.114

www.google.com. 156 IN A 74.125.237.112

;; Query time: 27 msec

;; SERVER: 127.0.0.1#53(203.119.98.119)

;; WHEN: Thu Jul 11 13:46:29 2013

;; MSG SIZE rcvd: 112

58

Page 59: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

59

Page 60: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS (for IPv4)

• Troubleshooting

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions (DNSSec)

• DNSSec Key Management and Automation

60

Page 61: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

What is ‘Reverse DNS’?

• ‘Forward DNS’ maps names to numbers

– svc00.apnic.net ➔192.168.1.100

– svc00.apnic.net ➔2001:DB8::1

• ‘Reverse DNS’ maps numbers to names

– 192.168.1.100 ➔ svc00.apnic.net

– 2001:DB8::1 ➔ svc00.apnic.net

Person (Host) Address (IPv4/IPv6)

61

Page 62: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Reverse DNS - why bother?

• Service denial

– only allow access when fully reverse delegated

– Example: anonymous ftp

• Diagnostics

– Used in tools such as traceroute

• Spam identifications

– Failed reverse lookup results in a spam penalty score

• Registration responsibilities

– APNIC members must make sure that all their address space are

properly reverse delegated

62

Page 63: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Principles – DNS Tree

Mapping numbers to names - ‘reverse DNS’

Root.

in-addr

202 203 204 210

64

22 22. 64. 202. in-addr.arpa.

net org com

whois

iana

www training

ws1

apnic

ws2

www

arpa

63

Page 64: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Creating Reverse Zones

• Same as creating a forward zone file

– SOA and initial NS records are the same as forward zone

• Create additional PTR records

• In addition to the forward zone files, you need the reverse

zone files

– Ex: for a reverse zone on a 203.176.189.0/24 block, create a zone

file and name it as “db.203.176.189” (make it descriptive)

64

Page 65: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Pointer (PTR) Records

• Create pointer (PTR) records for each IP address

or

131.28.12.202.in-addr.arpa. IN PTR svc00.apnic.net.

131 IN PTR svc00.apnic.net.

65

Page 66: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Reverse Zone Example$ORIGIN 1.168.192.in-addr.arpa.

@ 3600 IN SOA test.company.org. (

sys\.admin.company.org.

2002021301 ; serial

1h ; refresh

30M ; retry

1W ; expiry

3600 ) ; neg. answ. ttl

NS ns.company.org.

NS ns2.company.org.

1 PTR gw.company.org.

router.company.org.

2 PTR ns.company.org.

66

Page 67: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Reverse Delegation

• /24 Delegations

– Address blocks should be assigned or allocated

– At least two name servers

• /16 Delegations

– Same as /24 delegations

– APNIC delegates entire zone to member

• < /24 Delegations

– Read “Classless IN-ADDR.ARPA delegation” (RFC 2317)

67

Page 68: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

APNIC & LIR Responsibilities

• APNIC

– Manage reverse delegations of address block distributed by APNIC

– Process requests for reverse delegation of network allocations

• LIR and members

– Be familiar with APNIC procedures

– Ensure that addresses are reverse-mapped

– Maintain nameservers for allocations

– Minimize pollution of DNS

68

Page 69: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Reverse Delegation Procedures

• Create a whois object for the reverse zone

– This can be done in MyAPNIC

• Verify nameserver and domain set up before submitting to

the database

• Provide the FQDN of two nameservers

• Provide the maintainer password

– Used to protect objects

69

Page 70: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Reverse Delegation Procedures

70

Page 71: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Whois domain object

domain: 28.12.202.in-addr.arpa

Descr: in-addr.arpa zone for 28.12.202.in-addr.arpa

admin-c: NO4-AP

tech-c: AIC1-AP

zone-c: NO4-AP

nserver: cumin.apnic.net

nserver: tinnie.apnic.net

nserver: tinnie.arin.net

mnt-by: MAINT-APNIC-AP

mnt-lower: MAINT-AP-DNS

changed: [email protected] 20021023

changed: [email protected] 20040109

changed: [email protected] 20091007

changed: [email protected] 20111208

source: APNIC

Reverse Zone

Contacts

Nameservers

Maintainers

71

Page 72: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS (for IPv6)

• Troubleshooting

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions (DNSSec)

• DNSSec Key Management and Automation

72

Page 73: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Reverse DNS Tree – with IPv6Root

.

in-addr

202 203

64

22

ip6

IPv6 addresses

net org com arpa

ianaapnic

73

Page 74: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

IPv6 Representation in the DNS

• Forward lookup support: Multiple RR records for name to

number

– AAAA (Similar to A RR for IPv4 )

• Reverse lookup support:

– Reverse nibble format for zone ip6.arpa

74

Page 75: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

IPv6 Reverse Lookups – PTR records

• Similar to the IPv4 reverse record

b.a.9.8.7.6.5.0.4.0.0.0.3.0.0.0.2.0.0.0.1.0.0.0.0.0.0.0.1.2.3.4.ip6.arpa.

IN PTR test.ip6.example.com.

• Example: The reverse name lookup for a host with address

3ffe:8050:201:1860:42::1

$ORIGIN 0.6.8.1.1.0.2.0.0.5.0.8.e.f.f.3.ip6.arpa.

1.0.0.0.0.0.0.0.0.0.0.0.2.4.0.0 14400 IN PTR

host.example.com.

75

Page 76: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

IPv6 Forward and Reverse Mappings

• Existing A record will not accommodate the 128 bit

addresses for IPv6

• BIND expects an A record data to be 32-bit address (in

dotted-octet format)

• An address record

– AAAA (RFC 1886)

• A reverse-mapping domain

– ip6.arpa

76

Page 77: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

IPv6 Forward Lookups

• Multiple addresses possible for any given name

– Ex: in a multi-homed situation

• Can assign A records and AAAA records to a given

name/domain

• Can also assign separate domains for IPv6 and IPv4

77

Page 78: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Example: Forward Zone

;; domain.edu

$TTL 86400

@ IN SOA ns1.domain.edu. root.domain.edu. (

2015050501 ; serial - YYYYMMDDXX

21600 ; refresh - 6 hours

1200 ; retry - 20 minutes

3600000 ; expire - long time

86400) ; minimum TTL - 24 hours

;; Nameservers

IN NS ns1.domain.edu.

IN NS ns2.domain.edu.

;; Hosts with just A records

host1 IN A 1.0.0.1

;; Hosts with both A and AAAA records

host2 IN A 1.0.0.2

IN AAAA 2001:468:100::2

78

Page 79: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Example: Reverse Zone

;; 0.0.0.0.0.0.1.0.8.6.4.0.1.0.0.2.rev;; These are reverses for 2001:468:100::/64)

;; File can be used for both ip6.arpa and ip6.int.

$TTL 86400

@ IN SOA ns1.domain.edu. root.domain.edu. (

2015050501 ; serial - YYYYMMDDXX

21600 ; refresh - 6 hours

1200 ; retry - 20 minutes

3600000 ; expire - long time

86400) ; minimum TTL - 24 hours

;; Nameservers

IN NS ns1.domain.edu.

IN NS ns2.domain.edu.

1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN PTR host1.ip6.domain.edu

2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN PTR host2.domain.edu

79

Page 80: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

80

Page 81: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS

• Troubleshooting and ACL

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions (DNSSec)

• DNSSec Key Management and Automation

81

Page 82: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Why Troubleshoot?

• What Can Go Wrong?

– Misconfigured zone

– Misconfigured server

– Misconfigured host

– Misconfigured network

82

Page 83: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Tools

• BIND Logging Facility

• named's built-in options

• ping and traceroute

• tcpdump and wireshark

• dig and nslookup

83

Page 84: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

The Best Way To Handle Mistakes

• Assume You Will Make Them

• Prepare The Name Server via Logging

84

Page 85: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

BIND Logging

• Telling named which messages to send

– category specification

• Telling named where to send messages

– channel specification

85

Page 86: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

BIND channels

• BIND can use syslog

• BIND can direct output to other files

channel my_dns_log {

file "seclog" versions 3 size 10m;

print-time yes;

print-category yes;

print-severity yes;

severity debug 3;

};

86

Page 87: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

BIND Categories

• BIND has many categories

• Short descriptions of each can be found in the

Administrator's Reference Manual (ARM)

category queries { my_dns_log; };

87

Page 88: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

So You've Set Up A Server

• What tests should be done?

• Test if the server up

– Is the (right) server running?

– Is the machine set up correctly?

• Test if data is being served

– Has the zone loaded?

– Have zone transfers happened?

88

Page 89: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Checking the Configuration

• To see named start, use the -g flag

– Keeps named process in the foreground

– Prints some diagnostics

– But does not execute logging

• When satisfied (i.e. no errors), kill the process and start

without –g flag to run in the background

• Other option– % named-checkconf (check for syntax only)

89

Page 90: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Is the Server Running?

• Make sure the server is running– dig @127.0.0.1 version.bind chaos txt

• This makes the name server do the simplest lookup it can -

its version string

• This also confirms which version you started

– Common upgrade error: running the old version

90

Page 91: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Is the Server Data Correct?

• Check the serial number to make sure the zone has loaded

dig @127.0.0.1 <zone> soa

• Also test changed data in case you forgot to update the

serial number

• In the secondary server, this check is made to see if the

zone transferred

91

Page 92: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Is the Server Reachable?

• If the dig tests fail, its time to test the environment (machine, network)

ping <server machine ip address>

• This tests basic network flow, common errors– Network interface not UP

– Routing to machine not correct

• Pinging locally is useful– Confirms that the IP address is correctly configured

92

Page 93: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Is the Server Listening?

• If the server does not respond, but machine responds to

ping

– look at system log files

– telnet server 53

– firewall running?

• Server will run even if it can't open the network port

– logs will show this

– telnet opens a TCP connection, tests whether port was opened at all

93

Page 94: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Using the Tools

• named itself

• Dig or nslookup

• host diagnostics

• packet sniffers

94

Page 95: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Built in to named

• named -g to retain command linenamed -g -c <conf file>

• named -d <level>

– sets the debug output volume

– <level>'s aren't strictly defined

– -d 3 is popular, -d 99 gives a lot of detail

95

Page 96: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

dig

• domain internet groper

• best tool for testing

• shows query and response syntax

• Included in the software

96

Page 97: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

FlagsFlags Meaning

AA Authoritative answer

RD Recursion desired

RA Recursion Available

AD Authenticated Data (DNSSEC only)

CD

Status Response Code

0 - NOERR No error

1 - FORMERR Format error

2 - SERVFAIL Nameserver unreachable

3 - NXDOMAIN Domain name not existing

4 - NOTIMPL Not implemented

5 - REFUSED Request refused

97

Page 98: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Non-BIND Tools

• Tools to make sure environment is right

– Tools to look at server machine

– Tools to test network

– Tools to see what messages are on the network

98

Page 99: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

ifconfig

• Interface configuration

ifconfig -a

• An operating system utility that shows the status of interfaces

• Warning, during boot up, ifconfig may configure interfaces

after named is started

– named can't open delayed addresses

99

Page 100: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

ping

• Checks routing, machine health

– Most useful if run from another host

– Could be reason "no servers are reached"

– Can be useful on local machine - to see if the interface is properly

configured

100

Page 101: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

traceroute

• If ping fails, traceroute can help pinpoint where trouble lies

– the problem may be routing

– if so - it's not named that needs fixing!

– but is it important to know...

101

Page 102: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

tcpdump and wireshark

• Once confident in the environment, problems with DNS

setup may exist

• To see what is happening in the protocol, use traffic sniffers

• These tools can help debug "forwarding" of queries

102

Page 103: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

103

Page 104: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS

• Troubleshooting and ACL

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions (DNSSec)

• DNSSec Key Management and Automation

104

Page 105: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Address Match List

• Elements:

– Individual IP addresses

– Addresses or netmask pairs

– Names of other ACLs

– Key names

• Used for:

– Restricting queries & zone xfer

– Authorizing dynamic updates

– Selecting interfaces to listen on

– Sorting responses

105

Page 106: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Notes on Address Match list

• Elements must be separated by “ ; ”

• The list must be terminated with a “ ; ”

• Elements of the address match list are checked

sequentially

• To negate elements of the address match list prepend

them with “!”

• Use acl statement to name an address match list

• ACL must be defined before it can be used elsewhere

106

Page 107: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Example: Address match lists

• For network 192.168.0.0 255.255.255.0

– { 192.168.0.0/24; }

• For network plus loopback

– { 192.168.0.0/24; 127.0.0.1; ::1; }

• Addresses plus key name

– { 192.168.0.0/24; 127.0.0.1; example.com;}

107

Page 108: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

ACL Statement

• Syntax:

acl <acl name> { address match list>};

• Example:

acl internal { 127.0.0.1; 192.168.0/24; };

acl dynamic-update { key dhcp.apnic.net; };

108

Page 109: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Notes on ACL Statement

• The acl name need not be quoted

• There are four predefined ACLs:

– any (Any IP address)

– none (No IP address)

– localhost (loopback, 127.0.0.1)

– localnets (all networks that is directly connected to the server)

109

Page 110: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Blackhole

options {

blackhole { ACL-name or itemized list;

};

};

110

Page 111: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Allow-transfer

zone "myzone.example." {

type master;

file "myzone.example.";

allow-transfer { ACL-name or itemized

list; };

};

111

Page 112: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Allow-Query

zone "myzone.example." {

type master;

file "myzone.example.";

allow-query { ACL-name or itemized

list; };

};

112

Page 113: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Listen-on

options {

listen-on port # { ACL-

name or itemized list;};

};

113

Page 114: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Masters

masters name { masters_list | ip_addr };

Ex:

masters nsX { 192.168.0.1; 2001:db8::1 ; };

zone “example.com” {

type slave;

masters { nsX; };

file “/link/to/db.example.com”;

};

114

Page 115: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Summary

• ACLs and Configuration options can be used to create

simple split DNS

• It is cumbersome and difficult to maintain

• Good operational practice suggests that ACLs and

configuration options be reviewed regularly to ensure that

they accurately reflect the desired behavior

115

Page 116: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Views

• a powerful new feature of BIND 9 that lets a name server

answer a DNS query differently depending on who is asking

• useful for implementing split DNS setup without having to

run multiple servers

116

Page 117: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Syntax

view view_name

[class] {

match-clients { address_match_list } ;

match-destinations {

address_match_list } ;

match-recursive-only yes_or_no ;

[ view_option; ...]

[ zone_statement; ...]

};

117

Page 118: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Example Config

view "internal" {// This should match our internal networks.match-clients { 10.0.0.0/8; };

// Provide recursive service to internal clients only.

recursion yes;

// Provide a complete view of the example.com zone

// including addresses of internal hosts.zone "example.com" {

type master;file "example-internal.db";

};};

118

Page 119: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Example Config (2)

view "external" {

// Match all clients not matched by the previous

view.

match-clients { any; };

// Refuse recursive service to external clients.

recursion no;

// Provide a restricted view of the example.com zone

// containing only publicly accessible hosts.

zone "example.com" {

type master;

file "example-external.db";

};

};

119

Page 120: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

120

Page 121: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS

• Troubleshooting

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions (DNSSec)

• DNSSec Key Management and Automation

121

Page 122: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Crypto Review

• Most security applications use crypto algorithms

– Symmetric key

– Public key crypto

– One-way hash functions

122

Page 123: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Symmetric Key Crypto

• Uses a single key to encrypt and decrypt data

• Also known as a secret-key or private key algorithm

• The key must be kept a “secret” to maintain security

• key lengths ranging from 40 to 256 bits

• Examples of symmetric key algorithms:

– DES, 3DES, AES, IDEA, RC5, RC6, Blowfish

123

Page 124: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Same shared secret key

Plaintext

ENCRYPTION

ALGORITHM

DECRYPTION

ALGORITHM

Ciphertext Plaintext

Encryption Key Decryption Key

Shared Key Shared KeySymmetric Key

Cryptography

Symmetric Encryption

124

Page 125: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Asymmetric Key Crypto

• Uses a public-private keypair

• Also called public key crypto

• Use one key to sign data, then the other key to verify

• Examples:

– RSA, DSA, El Gamal, Diffie-Hellman, PKCS

125

Page 126: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Asymmetric Encryption

Plaintext

ENCRYPTION

ALGORITHM

DECRYPTION

ALGORITHM

Ciphertext Plaintext

Encryption Key Decryption Key

Public Key Private KeyAsymmetric Key

Cryptography

Different keys

126

Page 127: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Hash Functions

• produces a condensed representation of a message

• takes an input message of arbitrary length and outputs

fixed-length code

– The fixed-length output is called the hash or message digest

• A form of signature that uniquely represents the data

• Uses:

– Verifying file integrity - if the hash changes, it means the data is either

compromised or altered in transit.

– Digitally signing documents

– Hashing passwords

127

Page 128: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Hash Functions

• Message Digest (MD) Algorithm

– Outputs a 128-bit fingerprint of an arbitrary-length input

– MD4 is obsolete, MD5 is widely-used

• Secure Hash Algorithm (SHA)

– SHA-1 produces a 160-bit message digest similar to MD5

– Widely-used on security applications (TLS, SSL, PGP, SSH, S/MIME,

IPsec)

– SHA-256, SHA-384, SHA-512 can produce hash values that are 256,

384, and 512-bits respectively

128

Page 129: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Digital Signature

• a message appended to a packet

• used to prove the identity of the sender and the integrity of

the packet

• how it works:

– sender signs the message with own private key

– receiver uses the sender’s public key to verify the signature

129

Page 130: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Message Authentication Code

• Provides integrity and authenticity

• How it works:

– In the sender side, the message is passed through a MAC algorithm

to get a MAC (or Tag)

– In the receiver side, the message is passed through the same

algorithm

– The output is compared with the received tag and should match

• Uses the same secret key

• Can also use hash function to generate the MAC, called

Hash-based Message Authentication Code (HMAC)

130

Page 131: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Security - Background

• The original DNS protocol wasn’t designed with security in mind

• As the Internet grows, it has become less trustworthy

• Some security problems:

– Using reverse DNS to impersonate hosts

– Software bugs (buffer overflows, bad pointer handling)

– Cache poisoning (putting inappropriate data into the cache)

131

Page 132: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Protocol Vulnerability

• DNS data can be corrupted as it transfers between primary server, resolver or forwarder

• There is no way to check the validity of DNS data– Resolver implementation can be exploited (predictable transaction

ID, buffer overflow, pointer handling)

– Caching forwarders can be polluted

– Corrupted DNS data might end up in caches and stay there for a long time

• DNS transactions can be compromised– Primary server sending data to wrong secondary server

132

Page 133: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS: Data Flow

master Caching forwarder

Zone administrator

Zone file

Dynamicupdates

1

2

slaves

3

4

5

resolver

133

Page 134: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

master Caching forwarder

Zone administrator

Zone file

Dynamicupdates

1

2

slaves

3

4

5

resolver

Server protection Data protection

Corrupting data Impersonating master

Unauthorized updates

Cache impersonation

Cache pollution by

Data spoofing

DNS Vulnerabilities

134

Page 135: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Cache Poisoning

(pretending to be

the authoritative

zone)

ns.example.com

Webserver

(192.168.1.1

2001:DB8::1)

DNS Caching

Server

Client

I want to access www.example.com

1

QID=645712

QID=64569

QID=64570

QID=64571

www.example.com 192.168.1.1

www.example.com 2001:DB8::1

match!

www.example.com 192.168.1.99

www.example.com 2001:DB8::9

3

3

Root/GTLD

QID=64571

135

Page 136: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Amplification

• A type of reflection attack combined with amplification

– Source of attack is reflected off another machine

– Traffic received is bigger (amplified) than the traffic sent by the

attacker

• UDP packet’s source address is spoofed

136

Page 137: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Amplification

Queries for

www.example.com

Attacker

ns.example.com

Victim Machine

DNS Recursive server

Compromised

Machines

(spoofed IP)

Root/GTLD

www.example.com 192.168.1.1

www.example.com 2001:DB8::1

137

Page 138: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Open Resolvers

• DNS servers that answer recursive queries from any host

on the Internet

– pose some “significant threat” to the global network infrastructure

• Often used in DNS-based DDoS attacks

• There’s a project that maps out open resolvers on the

Internet

– Open Resolver Project - http://openresolverproject.org/

• Some utility available to check if running an open resolver

138

Page 139: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Open Resolvers

Reference: Open Resolver Project

As of 28 Aug 2014:

25381817 servers responded to udp/53 probe

20211408 returned OK

139

Page 140: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Open Resolvers Statistics

Source: DNS Measurement

Factory

140

Page 141: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Changer

• “Criminals have learned that if they can control a user’s

DNS servers, they can control what sites the user connects

to the Internet.”

• How: infect computers with a malicious software (malware)

• A malware changes the user’s DNS settings with that of the

attacker’s DNS servers

• Points the DNS configuration to DNS resolvers in specific

address blocks and use it for their criminal enterprise

Source: DCWG

141

Page 142: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Changer

• IP addresses used by malware. These blocks have now

been cleaned and re-allocated.

– 85.225.112.0 through 85.255.127.255

– 67.210.0.0 through 67.210.15.255

– 93.188.160.0 through 93.188.167.255

– 77.67.83.0 through 77.67.83.255

– 213.109.64.0 through 213.109.79.255

– 64.28.176.0 through 64.28.191.255

• An adhoc group – DNS Changer Working Group – was

created in 2012 to help remediate these malicious DNS

servers

Source: DCWG

142

Page 143: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Hijacking

• Also called DNS redirection

• Can be achieved when

– User’s DNS settings has been modified through malware

– DNS server has been compromised to provide incorrect responses

143

Page 144: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Case: Attack at Spamhaus

http://blog.cloudflare.com/deep-inside-a-dns-amplification-ddos-attack

http://blog.cloudflare.com/the-ddos-that-knocked-spamhaus-offline-

and-ho 144

Page 145: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Case: DNS Query Floods

• (May 2014) Targeted a chat service provider under Akamai

• Bandwidth used maxed at 119 Gbps

• Resulted to 110 Mpps – one of the highest packet-per-second (pps) rate for Akamai in 2014

Source: Prolexic Q2 2014 Global Attack Report145

Page 146: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Securing the Nameserver

• Run the most recent version of the DNS software or apply

the latest patch

• Restrict queries

• Prevent unauthorized zone transfers

• Run BIND with the least privilege (use chroot)

• Randomize source ports

• Secure the box

• Implement TSIG and DNSSEC

146

Page 147: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Response Rate Limiting (RRL)

• Protects against DNS amplification attack

• Implemented in CZ-NIC Knot (v1.2-RC3), NLNetLabs NSD

(v3.2.15), and ISC BIND 9 (v9.9.4) releaserate-limit {

responses-per-second 5;

log-only yes;

};

• If using older versions, a patch is available from

– http://ss.vix.su/~vjs/rrlrpz.html

– patch –p0 -l

147

Page 148: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Sender Policy Framework (SPF)

• Using DNS for email validation

• Checks the sender IP address

• Defined in RFC 4408 with updates in RFC 6652

apnic.net. 3600 IN TXT "v=spf1 mx

a:clove.apnic.net a:asmtp.apnic.net ip4:203.119.93.0/24

ip4:203.119.101.0/24 ip4:203.89.255.141/32

ip4:203.190.232.30/32 ip4:122.248.232.184/32

include:_spf.google.com -all"

148

Page 149: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DANE

• DNS-Based Authentication of Named Entities

• RFC 6698 (proposed standard)

• “secure method to associate the certificate that is obtained

from the TLS server with a domain name using DNS”

• Adds a TLSA resource record

149

Page 150: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS RPZ

• Resource Policy Zone

• Developed for ISC Bind. Built in from version 9.8

• Turns a recursive DNS server into a “DNS firewall”

• “reputation-based” zones

• Like creating a reputation server for recursive DNS servers

– Function is similar to DNSBL for email SMTP servers

• Blocks DNS resolution to malicious hosts

150

Page 151: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

151

Page 152: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS

• Troubleshooting

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions (DNSSec)

• DNSSec Key Management and Automation

152

Page 153: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Transactions - Protected Vulnerabilities

Unauthorized updates

master Caching forwarder

Zone administrator

Zone file

Dynamicupdates

slavesresolver

Impersonating master

153

DNS query/response, zone transfers,

Dynamic updates

Page 154: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNS Transactions

• Remote Name Daemon Controller (RNDC)

– Protects the remote CLI administration using shared key

– Prevents unauthorized access to named

• Transaction Signature (TSIG)

– Protects transactions using shared keys between both parties

• SIG(0)

– Protects transactions using asymmetric key (public and private

keypair)

154

Page 155: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

What is Transaction Signature?

• A mechanism for protecting a message from primary to

secondary (and vice versa)

• Provides secure communication of queries and responses

– Also protects zone transfers and dynamic updates

• How?

– A keyed-hash is applied so recipient can verify the message source

• Based on a shared secret - both sender and receiver are

configured with it

155

Page 156: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

SOA

SOA

Sig ...

Master

AXFR

TSIG example

Slave

KEY:

%sgs!f23fv

KEY:

%sgs!f23fv

AXFR

Sig ...Sig ...

SOA

SOA

Sig ...

Slave

KEY:

%sgs!f23fv

verification

verification

Query: AXFR

Response: Zone

156

Page 157: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

TSIG steps

1. Generate secret

2. Communicate secret

3. Configure servers

4. Test

157

Page 158: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

TSIG - Names and Secrets

• TSIG name

– A name is given to the key, the name is what is transmitted in the

message (so receiver knows what key the sender used)

• TSIG secret value

– A value determined during key generation

– Usually seen in Base64 encoding

158

Page 159: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

TSIG – Generating a Secret

• dnssec-keygen

– A simple tool to generate keys

– Used here to generate TSIG keys

dnssec-keygen -a <algorithm> -b <bits> -n host <name

of the key>

159

Page 160: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

TSIG – Generating a Secret

• Example

> dnssec-keygen –a HMAC-SHA256 –b 256 –n HOST ns1-

ns2.pcx.net

This will generate the key

Kns1-ns2.pcx.net.+157+15921

>ls

Kns1-ns2.pcx.net.+157+15921.key

Kns1-ns2.pcx.net.+157+15921.private

160

Page 161: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

TSIG – Generating a Secret

• TSIG is used in server configuration, not in zone file

• Could be confusing because it looks like RR

ns1-ns2.pcx.net. IN KEY 128 3 157 nEfRX9…bbPn7lyQtE=

161

Page 162: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

TSIG – Configuring Servers

• Configuring the key

key { algorithm ...; secret ...;}

• Making use of the key

server x { key ...; }

where x is the IP address of the other server

162

Page 163: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Configuration Example – named.confPrimary server 192.168.1.100

key ns1-ns2.pcx. net {

algorithm hmac-md5;

secret "APlaceToBe";

};

server 192.168.1.200 {

keys {ns1-ns2.pcx.net;};

};

zone "my.zone.test." {

type master;

file “db.myzone”;

allow-transfer {

key ns1-ns2.pcx.net ;};

};

Secondary server 192.168.1.200

key ns1-ns2.pcx.net {

algorithm hmac-md5;

secret "APlaceToBe";

};

server 192.168.1.100 {

keys {ns1-ns2.pcx.net;};

};

zone "my.zone.test." {

type slave;

file “myzone.backup”;

masters {192.168.1.100;};

};

You can save this in a file and refer to it in the named.conf

using ‘include’ statement:

include “/var/named/master/tsig-key-ns1-ns2”;

163

Page 164: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

TSIG Testing - dig

• You can use dig to check TSIG configuration– dig @<server> <zone> AXFR -k <TSIG keyfile>

dig @localhost example.net AXFR \

-k Kns1-ns2.pcx.net.+157+15921.key

• A wrong key will give “Transfer failed” and will be logged

on the server’s using the security-category

164

Page 165: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

TSIG Testing - Time

• TSIG is time sensitive

• Message protection expires in 5 minutes

– Make sure time is synchronized

– For testing, set the time

– In operations, (secure) NTP is needed

165

Page 166: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

TSIG steps

1. Generate secretdnssec-keygen -a <algorithm> -b <bits> -n host

<name of the key>

2. Communicate secretscp <keyfile> <user>@<remote-server>:<path>

3. Configure serverskey { algorithm ...; secret ...;}

server x { key ...; }

4. Testdig @<server> <zone> AXFR -k <keyfile>

166

Page 167: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

167

Page 168: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS

• Troubleshooting

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions

• DNSsec Key Management and Automation

168

Page 169: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Vulnerabilities protected by

DNSKEY / RRSIG / NSECCache impersonation

Cache pollution by

Data spoofing

master Caching forwarder

Zone administrator

Zone file

Dynamicupdates

slavesresolver

169

Page 170: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

What is DNSSEC?

• DNS Security Extensions

• Protects the integrity of data in DNS by establishing a chain

of trust

• A form of digitally signing the data to attest its validity

• Uses public key cryptography – each link in the chain has a

public/private key pair

• Provides a mechanism to:

– establish authenticity and integrity of data

– delegate trust to third parties or parent zones

170

Page 171: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC History

• 1990: Steven Bellovin discovers a major flaw in the DNS

• 1995: Bellovin publishes his research; DNSSEC becomes a

topic within IETF

• 1998: Dan Kaminsky discovers some security flaw

• 1999: RFC 2535, the DNSSEC protocol, is published

• 2005: Three new RFCs published to update RFC2535

– RFC 4033 (DNS Security Introduction and Requirements)

– RFC 4034 (Resource Records for DNS Security Extensions)

– RFC 4035 (Protocol Modifications)

https://wiki.tools.isoc.org/DNSSEC_History_Project

171

Page 172: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC History

• 2005: In October, Sweden (.SE) becomes the first ccTLD to

deploy DNSSEC

• 2008: new DNSSEC record created to address privacy

concerns (RFC 5155)

• 2010

– In July 15, the root zone was signed

– In July 29, .edu was signed

– In December 9, .net was signed

• 2011: In March 31, .com was signed

https://wiki.tools.isoc.org/DNSSEC_History_Project

172

Page 173: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

How DNSSEC Works

• Records are signed with private key to prove its authenticity

and integrity

• The signatures are published in DNS

• Public key is also published so record signatures can be

verified

• Child zones also sign their records with their private key

• Parent signs the hash of child zone’s public key to prove

authenticity

173

Page 174: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

How DNSSEC Works

• Authoritative servers

– Sign their zones

– Answer queries with the record requested

– Also send the digital signature corresponding to the record

• Validating Resolvers

– Authenticates the responses from the server

– Data that is not validated results to “SERVFAIL”

174

Page 175: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

New Concepts in DNSSEC

• New resource records

• Chain of trust

• Key generation and signing

• Validation

175

Page 176: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

New Resource Records

Resource

Record

Function

RRSIG Resource Record Signature Signature over RRset made using

private key

DNSKEY DNS Key Public key needed for verifying a

RRSIG

DS Delegation Signer Pointer for building chains of

authentication

NSEC /

NSEC3

Next Secure indicates which name is the next

one in the zone and which type

codes are available for the current

name

176

Page 177: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

New Resource Records

• RRsets are signed with private key to prove its authenticity

and integrity

• The signatures are published in DNS as RRSIG

• Public DNSKEY is also published so RRSIG can be verified

• Child zones also sign their records with their private key

• Parent signs the child zone’s DS record to prove

authenticity

177

Page 178: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

RRs and RRsets

• Resource Record – each entry in the zonefile

www.example.net. 7200 IN A 192.168.1.1

• RRset - RRs with same name, class and type

www.example.net. 7200 IN A 192.168.1.1

web1.example.net. 7200IN A 10.0.0.1

web2.example.net. 7200IN A 172.16.0.20

178

In DNSSEC, RRsets are signed and not the individual RRs

Page 179: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSKEY

• Contains the zone’s public key

• Uses public key cryptography to sign and authenticate DNS

resource record sets (RRsets).

• Example:

irrashai.net. IN DNSKEY 256 3 5 (

AwEAAagrVFd9xyFMQRjO4DlkL0dgUCtogviS+FG9Z6Au3h1ERe4EIi3L

X49Ce1OFahdR2wPZyVeDvH6X4qlLnMQJsd7oFi4S9Ng+hLkgpm/n+otE

kKiXGZzZn4vW0okuC0hHG2XU5zJhkct73FZzbmBvGxpF4svo5PPWZqVb

H48T5Y/9 ) ; key id = 3510

16-bit field flag; 256 if ZSK, 257 if KSK

Protocol octet

DNSKEY algorithm number

Public key (base64)

179

Page 180: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSKEY

• Also contains some timing metadata – as a comment in the

key file

; This is a key-signing key, keyid 19996, for myzone.net.

; Created: 20121102020008 (Fri Nov 2 12:00:08 2012)

; Publish: 20121102020008 (Fri Nov 2 12:00:08 2012)

; Activate: 20121102020008 (Fri Nov 2 12:00:08 2012)

180

Page 181: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

RRSIG

• The private part of the key-pair is used to sign the resource record set (Rrset)

• The digital signature per RRset is saved in an RRSIG record

irrashai.net. 86400 NS NS.JAZZI.COM.

86400 NS NS.IRRASHAI.NET.

86400 RRSIG NS 5 2 86400 (

20121202010528 20121102010528 3510 irrashai.net.

Y2J2NQ+CVqQRjQvcWY256ffiw5mp0OQTQUF8

vUHSHyUbbhmE56eJimqDhXb8qwl/Fjl40/km

lzmQC5CmgugB/qjgLHZbuvSfd9W+UCwkxbwx

3HonAPr3C+0HVqP8rSqGRqSq0VbR7LzNeayl

BkumLDoriQxceV4z3d2jFv4ArnM= )

RR type signed

Digital signature algorithm

Number of labels in the

signed name

Signature expiry

Date signed

181

Page 182: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

NSEC Record

• Next Secure

• Forms a chain of authoritative owner names in the zone

• Lists two separate things:

– Next owner name (canonical ordering)

– Set of RR types present at the NSEC RR’s owner name

• Also proves the non-existence of a domain

• Each NSEC record also has a corresponding RRSIG

myzone.net. NSEC blog.myzone.net. A NS SOA MX RRSIG NSEC DNSKEY

182

Page 183: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

NSEC RDATA

• Points to the next domain name in the zone– also lists what are all the existing RRs for “name”

– NSEC record for last name “wraps around” to first name in zone

• Used for authenticated denial-of-existence of data– authenticated non-existence of TYPEs and labels

183

Page 184: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

NSEC Record – Example

$ORIGIN example.net.

@ SOA …

NS NS.example.net.

DNSKEY …

NSEC mailbox.example.net. SOA NS NSEC DNSKEY RRSIG

mailbox A 192.168.10.2

NSEC www.example.net. A NSEC RRSIG

WWW A 192.168.10.3

TXT Public webserver

NSEC example.net. A NSEC RRSIG TXT

184

Page 185: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

NSEC3

• NSEC allows an attacker to walk through the linked list to

find all the records in the zone file. This is called zone

walking.

• NSEC3 uses a hashing algorithm to list the next available

domain in “hashed” format

• It is still possible for an attacker to do zone walking,

although at a higher computation cost.

185

Page 186: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DS Record

• Delegation Signer

• Establishes authentication chains between DNS zones

• Must be added in the parent’s zonefile

• In this example, irrashai.net has been delegated from .net. This record is added in the.net zone file

irrashai.net. IN NS ns1.irrashai.net.NS ns2.irrashai.net.

IN DS 19996 5 1 ( CF96B018A496CD1A68EE7C80A37EDFC6ABBF8175 )

IN DS 19996 5 2 (6927A531B0D89A7A4F13E110314C722EC156FF926D2052C7D8D70C50 14598CE9 )

Key ID

DNSKEY algorithm (RSASHA1)

Digest type: 1 = SHA1

2 = SHA256

186

Page 187: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DS Record

• indicates that delegated zone is digitally signed

• Verifies that indicated key is used for the delegated

zone

• Parent is authoritative for the DS of the child zone

– Not for the NS record delegating the child zone

– DS should not be added in the child zone

187

Page 188: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Chain of Trust

• Establishes a chain of trust from parent to child zone

• How?

– Parent does not sign child zone

– Parent only signs a pointer to the child zone (key) – DS RECORD

• The root is on top of the chain

188

Page 189: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Creation of keys

• In practice, we use two keypairs

– one to sign the zones, another to sign the other key

• Using a single key or both keys is an operational choice

(RFC allows both methods)

• If using a single key-pair:

– Zones are digitally signed using the private key

– Public key is published using DNSKEY RR

– When key is updated, DS record must again be sent to parent zone

• To address this administrative load, two keypairs will be

used

189

Page 190: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Types of Keys

• Zone Signing Key (ZSK)

– Signs the RRsets within the zone

– Signed by the KSK

– Uses flag 256

• Key Signing Key (KSK)

– Signs the ZSK

– Pointed to by the parent zone

– Acts as the secure entry point to the

190

Page 191: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Signature Expiration

• Keys do not expire

– Still a good practice to generate new ones regularly for added

security

• Signatures have validity period

– By default set to 30 days

– This info is added in the key metadata

• Expired signatures will not validate

– Must re-sign the zones

191

Page 192: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC Deployment in ccTLDs

Ref: http://rick.eng.br/dnssecstat/

192

Page 193: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC Validation Rate

193

http://stats.labs.apnic.net/dnssec

Page 194: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC Practice Statement

• RFC 6841 (Informational) - Jan 2013

• “a means for stakeholders to evaluate the strength and

security of the DNSSEC chain of trust, an entity operating a

DNSSEC-enabled zone may publish a DNSSEC Practice

Statement (DPS)”

– DNSSEC Policies (DPs) – security requirements and standards to be

implemented for a DNSSEC-signed zone

– DNSSEC Practice Statement (DPS) – practice disclosure document;

states how the management of a given zone implements procedures

and controls at a high level

• The DPS for Root Zone Signing Key (ZSK) is published

– https://www.iana.org/dnssec/icann-dps.txtRef: RFC6841

194

Page 195: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

What you can do - Registries /

Hosting Providers

• Sign your zones

• Before fully implementing:

– Plan about key rollover

– Think about securing your keys

– What happens if your key gets compromised

195

Page 196: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

What you can do – ISPs and Clients

• Enable DNSSEC on your recursive servers and validate

responses

• Before you fully implement:

– Domains that can’t be validated will be inaccessible

– Be prepared to answer helpdesk queries related to this

196

Page 197: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

197

Page 198: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Implementing

DNSSEC

198

Page 199: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC in the Resolver

• Recursive servers that are dnssec-enabled can validate

signed zones

• Enable DNSSEC validation

dnssec-validation yes;

• The AD bit in the message flag shows if validated

199

Page 200: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC Validation

• Other options if you don’t have a validating resolver

– validator add-on for your web browser

• ex: https://www.dnssec-validator.cz/

– Online web tools

• http://dnsviz.net/

• http://dnssec-debugger.verisignlabs.com/

• Use an open DNSSEC-validating resolver

– DNS-OARC’s ODVR (link)• 149.20.64.20 (BIND9), 149.20.64.21 (Unbound)

– Google Public DNS

• 8.8.8.8 or 8.8.4.4

200

Page 201: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC - Setting up a Secure Zone

• Enable DNSSEC in the configuration file (named.conf)– dnssec-enable yes; dnssec-validation yes;

• Create key pairs (KSK and ZSK)– dnssec-keygen -a rsasha1 -b 1024 -n zone

champika.net

• Publish your public key

• Signing the zone

• Update the config file

– Modify the zone statement, replace with the signed zone file

• Test with dig

201

Page 202: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Updating the DNS Configuration

• Enable DNSSEC in the configuration file (named.conf)

options {

directory “….”

dnssec-enable yes;

dnssec-validation yes;

};

• Other options that can be added laterauto-dnssec { off | allow | maintain} ;

– These options are used to automate the signing and key rollover

202

Page 203: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Generating Key Pairs

• Generate ZSK and KSK

dnssec-keygen -a rsasha1 -b 1024 -n zone <myzone>

Default values are RSASHA1 for algorithm, 1024 bits for ZSK and 2048 bits for KSK

The command above can be simplified as:

dnssec-keygen –f KSK <myzone>

This generates four files.

Note: There has to be at least one public/private key pair for each DNSSEC zone

203

Page 204: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Generating Key Pairs

• To create ZSK

dnssec-keygen -a rsasha1 -b 1024 -n zone

myzone.net

• To create KSK

dnssec-keygen -a rsasha1 -b 2048 -f KSK -n

zone myzone.net

204

Page 205: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Generating Key Pairs - Reverse

• To create ZSK

dnssec-keygen -a rsasha1 -b 1024 -n zone

100.168.192.in-addr.arpa

• To create KSK

dnssec-keygen -a rsasha1 -b 2048 -f KSK -n

zone 100.168.192.in-addr.arpa

205

Page 206: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Publishing the Public Key

• Using $INCLUDE you can call the public key (DNSKEY

RR) inside the zone file

$INCLUDE /path/Kmyzone.net.+005+33633.key ; ZSK

$INCLUDE /path/Kmyzone.net.+005+00478.key ; KSK

• You can also manually enter the DNSKEY RR in the zone

file

206

Page 207: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Signing the Zone

• Sign the zone using the secret keys:

dnssec-signzone –o <zonename> -N INCREMENT -f

<output-file> -k <KSKfile> <zonefile> <ZSKfile>

dnssec-signzone –o myzone.net db.myzone.net

Kmyzone.net.+005+33633

• Once you sign the zone a file with a .signed extension will

be created– db.myzone.net.signed

207

Page 208: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Signing the Zone

• Note that only authoritative records are signed

– NS records for the zone itself are signed

– NS records used for delegations are not signed

– DS records are signed

– Glue records are not signed

• Notice the difference in file size

– db.myzone.net vs. db.myzone.net.signed

208

Page 209: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Smart Signing

• Searches the key repository for any keys that will match the

zone being signed

options {

keys-directory { “path/to/keys”;

};

• Then the command for smart signing is dnssec-signzone –S db.myzone.net

209

Page 210: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Publishing the Zone

• Reconfigure to load the signed zone. Edit named.conf and

point to the signed zone.

zone “<myzone>” {

type master;

# file “db.myzone.net”;

file “db.myzone.net.signed”;

};

210

Page 211: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Publishing the Zone – Reverse

• Reconfigure to load the signed zone. Edit named.conf and

point to the signed zone.

zone “<myzone>” {

type master;

# file “db.192.168.100”;

file “db.192.168.100.signed”;

};

211

Page 212: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Testing the Server

• Ask a dnssec-enabled server and see whether the answer

is signed

dig @localhost www.apnic.net +dnssec

+multiline

212

Page 213: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Testing with Digdig @localhost www.irrashai.net +dnssec (+multiline)

213

Page 214: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Testing with Dig – Reversedig @localhost -x 192.168.100.100 +dnssec

214

Page 215: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Pushing the DS record

• The DS record must be published by the parent zone.

• Contact the parent zone to communicate the KSK to them.

• There are proposals in the IETF DNSOP WG to address

this:

– Automating DNSSEC Delegation Trust Maintenance (link)

– Child to Parent Synchronization in DNS (link)

215

Page 216: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Pushing DS Records for Forward

Zone

216

Example form for Godaddy

Page 217: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Pushing DS Record for Reverse Zone

217

DS record added in the

domain object

Using MyAPNIC

Page 218: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Ways to Deploy DNSSEC

• As part of the DNS software used

– Manual key management

– Can be quite complex

– For static environment

– Some means of automation using

• option commands and scripts

• Use with a hardware security module (HSM)

– Semi-automatic

– Good for dynamic environment

• Using an external appliance

– ‘dnssec-in-a-box’

– Fully automates key generation, signing and rollover

DNSSEC tools for BIND,

NSD, PowerDNS, etc

HSM,

OpenDNSSEC

DNS Appliance

218

Page 219: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Hardware Security Module

• Cryptographic devices used for storage of the encryption

keys

– Smart cards, PCI cards, USB tokens

• It also speeds up the cryptographic key generation

• Implements PKCS#11 (Cryptographic Token Key Interface)

– A standard interface or API to cryptographic tokens

219

Page 220: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC Signer Appliance

DNS Master

• Creates the zones as per usual

DNSSEC Signer

• Signs the zones

• Propagates the signed zones

DNS Server

• Answer queries

• Can be a pure signer or packaged with an IPAM or a DNS

server

• In pure signer, the hardware appliance interfaces between

the master/slave servers

• Examples: Secure64, Xelerance, SolidDNS, etc

220

Page 221: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

221

Page 222: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Overview

• DNS Overview

• BIND DNS Configuration

• Recursive and Forward DNS

• Reverse DNS

• Troubleshooting

• DNS Security Overview

• DNS Transactions

• DNS Security Extensions (DNSSec)

• DNSsec Key Management and Automation

222

Page 223: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

KSK Key Rollover

Using Double signing

• When you change the KSK keys, the DS record in the

parent zone must also be updateddnssec-signzone –o myzone.net –N increment –f <output- \

file> -k Kmyzone.net.+005+11111 db.myzone.net \

Kmyzone.net.+005+67890

• Send the new DS record to the parent, and wait for it to

propagate

• Remove the old key and re-sign

223

Page 224: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

KSK Key Rollover

Using Pre-publication

• In this method, the new key will be published but will not be

used for signing yet.dnssec-keygen –K keydir –f ksk –A none <myzone.net>

rndc loadkeys <myzone.net>

• Publish both keys, but use only the old one for signing

• Wait for the propagation time and TTL of the DNSKEY RR

to expire.

224

Page 225: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

KSK Key Rollover

• Then use dnssec-settime once you are ready to sign the zone. Use the new key for zone signing, leaving the old one published.

dnssec-settime –K keydir –A now Kmyzone.net.+005+12345

rndc loadkeys myzone.net

• Wait for the propagation and TTL in the old zone. Set the old key to no longer sign with the key, but leaves it in the zone.

dnssec-settime –K keydir -I now Kmyzone.net.+005+12345

rndc loadkeys myzone.net

• Now remove the old keys. This completely removes the keys.

dnssec-settime –K keydir -D now Kmyzone.net.+005+12345

rndc loadkeys myzone.net

225

Page 226: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Other Options – Automated Signing

• Using RNDC

• Add the option to named.confauto-dnssec allow;

• Then you can use the commands:rndc loadkeys zone

rndc sign zone

226

Page 227: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC Operational Practices

RFC 6781

• Lists down choices and decisions available when deploying DNSSEC

• Keep the chain of trust– Broken chains result in data being marked as Bogus

– Shared responsibility by admins

• Key generation and storage– The motivations to differentiate KSK and ZSK are purely operational

– Timing parameters

– Key compromise and risk of cryptanalysis

– Keys should be large enough to avoid all known crypto attacks during the effectivity period of the key

– zone private keys and the zone file master copy to be signed be kept and used in off-line

227

https://tools.ietf.org/html/rfc6781

Page 228: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC Operational Practices

RFC 6781

• Signature generation, key rollover and policies

– Data published in previous versions still live in caches

– ZSK can be rolled without taking into account the DS record from

parent

– KSK rollover requires interaction with the parent

– Emergency key rollover

• Motivation to deploy NSEC3 over NSEC

– Prevention of zone enumeration

228

https://tools.ietf.org/html/rfc6781

Page 229: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC Practice Statement – RFC

6841

• a means for stakeholders to evaluate the strength and

security of the DNSSEC chain of trust

• DNSSEC Policies (DPs) – security requirements and

standards to be implemented for a DNSSEC-signed zone

• DNSSEC Practice Statement (DPS) – practice disclosure

document; states how the management of a given zone

implements procedures and controls at a high level

229

https://tools.ietf.org/html/rfc6841

Page 230: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC Practice Statement

• The DPS for Root Zone Signing Key (ZSK) is published

– https://www.iana.org/dnssec/icann-dps.txt

• Published DPS of TLD operators.SE's DNSSEC Practice Statement

www.iis.se/docs/se-dnssec-dps-eng.pdf

.CL's DNSSEC Practice Statement

http://www.nic.cl/dnssec/en/dps.html

.NET DNSSEC Practice Statement

http://www.verisigninc.com/assets/20100925-NET+DPS-

FINAL.pdf

230

Page 231: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

DNSSEC Guides

• Good Practice Guide for Deploying DNSSEC

– ENISA

– Published 2010

• Secure Domain Name System Deployment Guide

– NIST

– Published 2013

231

Page 232: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

232

Page 233: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

OpenDNSSEC

233

Page 234: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

What is OpenDNSSEC?

• An open source turn-key solution

for managing DNSSEC

• The goal is to simplify the signing

process and minimize the

workload on the admin

• Uses PKCS#11 for key storage

• Check out the documentation

– https://wiki.opendnssec.org/display

/DOCS

Reference: http://www.opendnssec.org/about/

Unsigned

zone

Input

Adapter

Signer

Engine

Signed

zone

Output

Adapter

Security

Module

KASP

enforcer

Key and

Signing

Policy

234

Page 235: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Installation (on CentOS 6.1)

• Install dependencies

– LDS (DNS programming library)

– libxml2 (libxml2, libxml2-dev, libxml2-utils)

– Java

– SQLite (sqlite3, libsqlite3, libsqlite3-dev)

– MySQL – optional

• Install a Hardware Security Module (HSM)

– Or an equivalent software emulation

• Install OpenDNSSEC

235

Page 236: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

SoftHSM Installation

• Software-only implementation of an HSM

• Dependencies– At least Botan 1.10.0 and OpenSSL 0.9.8

• Install from a repository or sourcetar xvzf softhsm-<version>.tar.gz

cd softhsm-<version>

./configure

make

sudo make install

• Edit the configuration file and specify the slots to be usedvi /etc/softhsm.conf

0:/var/softhsm/slot0.db

236

Page 237: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

SoftHSM

• Although the HSM has been defined, it has to be initializedsofthsm --init-token –slot 0 –label “opendnssec”

• Check that this HSM repository is configured in

OpenDNSSEC’s conf.xml<Repository name="SoftHSM”>

<Module>/usr/local/lib/libsofthsm.so</Module>

<TokenLabel>OpenDNSSEC</TokenLabel>

<PIN>1234</PIN>

</Repository>

237

Page 238: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

OpenDNSSEC

• Install from repositoryyum –y install opendnssec

• Important files

– conf.xml – overall configuration

– kasp.xml – policies used to sign zones; key and signature policy

– zonelist.xml – list of zones that opendnssec will sign

– addns.xml – dns adapter configuration

• The config folder is set to /etc/opendnssec/ by default

238

Page 239: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Conf.xml

• overall configuration

<RepositoryList> - defines the

HSM

<Common> - common config

<Enforcer> - deals with key

rollover and generation

<Signer> - the part that constructs

the signature records to include in the

zone file

Note the repository name

Reference to kasp.xml and zonelist.xml

239

Page 240: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Timing Parameters

• P[n]Y[n]M[n]DT[n]H[n]M[n]S

• P1Y6MT12H – 1 year, 6 months, and 12 hours

• P1Y – 1 year (always 365 days)

• P1M – 1 month (always 31 days)

240

Page 241: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Running OpenDNSSEC

• To begin with, run the commandods-ksmutil setup

• Two daemons must be started – ods-signerd and ods-

enforced. Use the command to start themods-control start

• Add zonesods-ksmutil zone add --zone <zonename>

• This can also be added manually by editing zonelist.xml. If

you do this, run the command after edit:ods-ksmutil update zone list

241

Page 242: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Running OpenDNSSEC

• To check if the config files are validods-kaspcheck

• To generate the DS record from KSKods-ksmutil key list –v (to get the keytag)

ods-ksmutil key export –z example.com –e publish –x

<keytag>

242

Page 243: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Error Logging

• Uses the system’s syslog for logging. Define a log facility to

where the messages will go<Logging>

<Syslog><Facility>local0</Facility></Syslog>

</Logging>

• Check your logfile – /var/log/messagestail –f /var/log/messages | grep ods*

• If you have syslog, you can edit /etc/rsyslog.conf to

243

Page 244: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

Troubleshooting

• Some common problems encountered:

• Starting opendnssec# ods-control start

Starting enforcer...

OpenDNSSEC ods-enforcerd started (version 1.4.1), pid

5601

Could not start enforcer

• Database not updated (when adding zones)

• Typo / error in the configuration files. Runods-kaspcheck

244

Page 245: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

245

Page 246: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

www.facebook.com/APNIC

www.twitter.com/apnic

www.youtube.com/apnicmultimedia

www.flickr.com/apnic

www.weibo.com/APNICrir

246

Page 247: DNS / DNSSEC Workshop - start [APNIC TRAINING WIKI]€¦ · DNS / DNSSEC Workshop Generic slides 03 November 2015 2.0-draft4. Overview • DNS Overview • BIND DNS Configuration

247247