Dnssec Bind Resolver Installation Hyperlocal - Hands On en
Dnssec Bind Resolver Installation Hyperlocal - Hands On en
Dnssec Bind Resolver Installation Hyperlocal - Hands On en
1
1) Preparing the System
2
c. Configure VM network adaptor to operate in Bridge Mode
d. Start the VM
3
e. Find the VM IP address (VM name: “yoda”)
# ip addr
4
f. Connecting to the server to install and configure BIND
$ ssh root@10.0.1.32
If you are using Windows, you may use the SSH client application
called PUTTY that (installed earlier) to connect to our server (yoda).
To install the packages needed to run BIND, we will use the above
commands (apt-get), one at a time.
If the installation process asks us if we want to install any of the
packages, we will say yes.
# ufw allow 53
5
3) Configuring BIND
b. The standard installation will already bring the information for locating
root servers
# more db.root
; OPERATED BY ICANN
;
. 3600000 NS L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42
L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42
;
; 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
; End of file
6
4) Editing BIND configuration files
# more named.conf.options
options {
directory "/var/cache/bind";
// forwarders {
// 0.0.0.0;
// };
//=============================================================
// If BIND logs error messages about the root key being
// expired,
// you will need to update your keys. See
// https://www.isc.org/bind-keys
//=============================================================
dnssec-validation auto;
//listen-on-v6 { any; };
dnssec-enable no;
//dnssec-validation auto;
7
When dnssec-validation is set to automatic, the default is the
DNS root zone as the trust anchor. BIND includes a copy of the
root key that is kept up to date automatically. If set to yes, a trust
anchor must be set up explicitly using the managed-keys or
trusted-keys option.
recursion yes;
# nano named.conf.options
options {
directory "/var/cache/bind";
// forwarders {
// 0.0.0.0;
// };
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-enable no;
//dnssec-validation auto;
recursion yes;
};
8
c. Finally, we use the BIND functionality to confirm that there are no
errors in the configuration files and restart the BIND server to apply the
configuration changes
# named-checkconf
# service bind9 restart
Now, for the test part of our recursive server, we will use a new virtual
machine. To do this, we run the second virtual machine (client) that we
previously installed.
9
6) We may adjust the client configuration (in the resolv.conf file) to use our BIND
server
# nano /etc/resolv.conf
nameserver 10.0.1.103
10
7) Using DIG command
$ dig
- What happens?
- What was the response time (query time)?
11
c. Recalling about dig response
$ dig dnssec-failed.org
What happens?
12
8) Enabling DNSSEC validation
# nano named.conf.options
dnssec-enable yes;
dnssec-validation auto;
We use the BIND functionality to confirm that there are no errors in the
configuration files and restart the BIND server to apply the configuration
changes
a. Testing
$ dig dnssec-failed.org
DNSKEY
$ dig nic.br DNSKEY
DS
$ dig nic.br DS
RRSIG
$ dig nic.br RRSIG
13
c. How to create an exception for DNSSEC in BIND
First, from the client, we do a DNS query for the domain dnssec-
failed.org
Now let's insert the exception on the DNS server using the command:
14
Finally, we do the DNS query again from the client for the same
domain; now getting the answer without DNSSEC validation (because
of the exception we made).
15
9) Setting up Hyperlocal on our DNS resolver
From RFC7706:
“Some DNS recursive resolvers have longer-than-desired round-trip times to
the closest DNS root server. Some DNS recursive resolver operators want to
prevent snooping of requests sent to DNS root servers by third parties. Such
resolvers can greatly decrease the round-trip time and prevent observation of
requests by running a copy of the full root zone on a loopback address (such
as 127.0.0.1). This document shows how to start and maintain such a copy of
the root zone that does not pose a threat to other users of the DNS, at the
cost of adding some operational fragility for the operator”
Source: https://www.ripe.net/analyse/dns/k-root/statistics/?type=ROOT&increment=yearly
16
a. Some test before configuring Hyperlocal
Note that we will do a query test (we will query from the client and not
the server) for a non-existent top-level domain (NXDOMAIN) to check
the approximate response time when querying a root server.
$ dig domaininvalid.com.br.xxxxxxx
# nano /etc/bind/named.conf.options
options {
directory "/var/cache/bind";
// forwarders {
// 8.8.8.8;
// };
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-enable yes;
dnssec-validation auto;
17
c. We edit the named.conf configuration file as follows:
# nano /etc/bind/named.conf
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
// We comment the following -include- because we will not use this configuration.
// Instead, we will use the transfer of the root zone (hypelocal).
//include "/etc/bind/named.conf.default-zones";
// To solve the root we will use the local root zone copy (hyperlocal)
zone "." {
type static-stub;
server-addresses { 127.0.0.1; };
};
};
18
d. We use the BIND functionality to confirm that there are no errors in the
configuration files and restart the BIND server to apply the
configuration changes
e. We can check the system log /var/log/syslog to verify that BIND has
been restarted correctly (we will certainly have warnings that IPv6
destinations are not accessible if we do not have IPv6 connectivity).
f. We check if the local file with the copy of the root zone (rootzone.db)
was created correctly:
# ls -lart /var/cache/bind/
19
g. Testing after Hyperlocal configuration
We will perform some query tests (we will query from the client and not
from the server) for nonexistent top-level domains (NXDOMAIN) to
check the approximate response time when querying different root
servers.
We compare the time obtained now with that obtained when we did not
have Hyperlocal configured.
END.
20