Size: 1694
Comment:
|
← Revision 11 as of 2021-01-22 16:16:09 ⇥
Size: 3388
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
= DNS Slave = |
|
Line 8: | Line 5: |
Since looking up the DNS servers IP-address does not make any sense, we will give the DNS server a statc IP-address. Edit `/etc/networking/interfaces` and make the following changes. | We will give the DNS slave a static IP-address. Edit `/etc/networking/interfaces` and make the following changes. |
Line 17: | Line 14: |
address 192.168.1.35 | address 192.168.1.37 |
Line 32: | Line 29: |
=== Stop BIND === {{{ service bind9 stop }}} |
|
Line 38: | Line 40: |
allow-notify { 192.168.1.35; }; | allow-notify { 192.168.1.37; }; |
Line 40: | Line 42: |
Line 41: | Line 44: |
Get the key from the master and save it in `/etc/bind/ddns-update.dnskey`. |
Get the key from the master and save it in `/etc/bind/ddns-update.kallenberg.dk`. |
Line 51: | Line 52: |
Make sure BIND can read `/etc/bind/ddns-update.kallenberg.dk`. {{{ chown root:bind /etc/bind/ddns-update.kallenberg.dk }}} |
|
Line 55: | Line 61: |
include "/etc/bind/ddns-update.dnskey"; | include "/etc/bind/ddns-update.kallenberg.dk"; |
Line 59: | Line 65: |
masters { 192.168.1.36; }; | |
Line 60: | Line 67: |
allow-transfer { 192.168.1.34; }; allow-update { key "ddns-update"; }; |
allow-transfer { 192.168.1.36; }; |
Line 66: | Line 72: |
masters { 192.168.1.36; }; | |
Line 67: | Line 74: |
allow-transfer { 192.168.1.34; }; allow-update { key "ddns-update"; }; |
allow-transfer { 192.168.1.36; }; |
Line 76: | Line 82: |
`/var/lib/bind/kallenberg.dk.zone` {{{ $ORIGIN . $TTL 86400 ; 1 day kallenberg.dk IN SOA ns01.kallenberg.dk. ns02.kallenberg.dk. ( 20171210 ; serial 7200 ; refresh (2 hours) 300 ; retry (5 minutes) 604800 ; expire (1 week) 60 ; minimum (1 minute) ) IN NS ns01.kallenberg.dk. IN NS ns02.kallenberg.dk. A 212.237.182.56 $ORIGIN kallenberg.dk. $TTL 86400 ; 1 day ns01 IN A 192.168.1.36 ns02 IN A 192.168.1.37 }}} `/var/lib/bind/1.168.192.zone` {{{ $ORIGIN . $TTL 86400 ; 1 day 1.168.192.in-addr.arpa IN SOA ns01.kallenberg.dk. ns02.kallenberg.dk. ( 20171210 ; serial 7200 ; refresh (2 hours) 300 ; retry (5 minutes) 604800 ; expire (1 week) 60 ; minimum (1 minute) ) IN NS ns01.kallenberg.dk. IN NS ns02.kallenberg.dk. $ORIGIN 1.168.192.in-addr.arpa. 36 IN PTR ns01.kallenberg.dk 37 IN PTR ns02.kallenberg.dk }}} === Start BIND === Finally start the service again {{{ service bind9 start }}} |
DNS Slave
Network
We will give the DNS slave a static IP-address. Edit /etc/networking/interfaces and make the following changes.
# The primary network interface #allow-hotplug eth0 #iface eth0 inet dhcp auto eth0 iface eth0 inet static address 192.168.1.37 network 192.168.1.0 netmask 255.255.255.0 broadcast 192.168.1.255 gateway 192.168.1.1
Install BIND
apt-get install bind9
Configure BIND
Stop BIND
service bind9 stop
Make BIND listen
edit /etc/bind/named.conf.options and add
listen-on { any; }; allow-notify { 192.168.1.37; };
Get the DDNS update key
Get the key from the master and save it in /etc/bind/ddns-update.kallenberg.dk.
key "ddns-update" { algorithm hmac-sha512; secret "yYFzfibvlpS33+vsngV2jF5tGkTiVSjhYoFuV0T7bnCVfFGx3Mu05SW+LakImdofkNM00LxHCLuvD1W1vSWMmA=="; };
Make sure BIND can read /etc/bind/ddns-update.kallenberg.dk.
chown root:bind /etc/bind/ddns-update.kallenberg.dk
Create a new zone
/etc/bind/named.conf.kallenberg.dk
# Key used by DHCP servers for dynamic DNS updates include "/etc/bind/ddns-update.kallenberg.dk"; zone "kallenberg.dk" { type slave; masters { 192.168.1.36; }; file "/var/lib/bind/kallenberg.dk.zone"; allow-transfer { 192.168.1.36; }; }; zone "1.168.192.in-addr.arpa" { type slave; masters { 192.168.1.36; }; file "/var/lib/bind/1.168.192.zone"; allow-transfer { 192.168.1.36; }; };
Add the new zone file to /etc/bind/named.conf.local
include "/etc/bind/named.conf.kallenberg.dk";
/var/lib/bind/kallenberg.dk.zone
$ORIGIN . $TTL 86400 ; 1 day kallenberg.dk IN SOA ns01.kallenberg.dk. ns02.kallenberg.dk. ( 20171210 ; serial 7200 ; refresh (2 hours) 300 ; retry (5 minutes) 604800 ; expire (1 week) 60 ; minimum (1 minute) ) IN NS ns01.kallenberg.dk. IN NS ns02.kallenberg.dk. A 212.237.182.56 $ORIGIN kallenberg.dk. $TTL 86400 ; 1 day ns01 IN A 192.168.1.36 ns02 IN A 192.168.1.37
/var/lib/bind/1.168.192.zone
$ORIGIN . $TTL 86400 ; 1 day 1.168.192.in-addr.arpa IN SOA ns01.kallenberg.dk. ns02.kallenberg.dk. ( 20171210 ; serial 7200 ; refresh (2 hours) 300 ; retry (5 minutes) 604800 ; expire (1 week) 60 ; minimum (1 minute) ) IN NS ns01.kallenberg.dk. IN NS ns02.kallenberg.dk. $ORIGIN 1.168.192.in-addr.arpa. 36 IN PTR ns01.kallenberg.dk 37 IN PTR ns02.kallenberg.dk
Start BIND
Finally start the service again
service bind9 start