Ubuntu DHCP/DNS Coupling

DNS

include "/etc/bind/ddns.key";
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
key DHCP_UPDATER {
         algorithm hmac-md5;
         secret "uFj0b3YjnGGVOxpjvmpVqQ==";
};
zone "intra.fablabwinti.ch"  {
        type master ;
        file "/var/lib/bind/db.intra.fablabwinti.ch" ;
        allow-update { key "DHCP_UPDATER"; };
};

zone "1.168.192.in-addr.arpa" {
        type master ;
        file "/var/lib/bind/db.192.168.1" ;
        allow-update { key "DHCP_UPDATER"; };
};
$ORIGIN .
$TTL 60	; 1 minute
intra.fablabwinti.ch	IN SOA	ns1.intra.fablabwinti.ch. info.intra.fablabwinti.ch. (
				2014082358 ; serial
				43200      ; refresh (12 hours)
				10         ; retry (10 seconds)
				1814400    ; expire (3 weeks)
				7200       ; minimum (2 hours)
				)
			NS	ns1.intra.fablabwinti.ch.
			NS	ns2.intra.fablabwinti.ch.
			A	192.168.1.2

$ORIGIN intra.fablabwinti.ch.
auth			A	192.168.1.2
ftp			A	192.168.1.2
mail			A	192.168.1.2
ns1			A	192.168.1.2
ns2			A	192.168.1.2
www			A	192.168.1.2
$ORIGIN .
$TTL 60	; 1 minute
1.168.192.in-addr.arpa	IN SOA	ns1.intra.fablabwinti.ch. info.intra.fablabwinti.ch. (
				2014076095 ; serial
				43200      ; refresh (12 hours)
				10         ; retry (10 seconds)
				1814400    ; expire (3 weeks)
				7200       ; minimum (2 hours)
				)
			NS	ns1.intra.fablabwinti.ch.
			NS	ns2.intra.fablabwinti.ch.
$ORIGIN 1.168.192.in-addr.arpa.
2			PTR	ns1.intra.fablabwinti.ch.

DHCP

key DHCP_UPDATER {
         algorithm HMAC-MD5.SIG-ALG.REG.INT;
         secret "uFj0b3YjnGGVOxpjvmpVqQ==";
};
authoritative;

default-lease-time      600;
max-lease-time          7200;

# DDNS statements
include "/etc/dhcp/ddns.key";
ddns-updates            on;                 # default but good practice
ddns-update-style       interim;            # only supported active option
allow                   client-updates;     # default but good practice
update-static-leases    on;

zone 1.168.192.in-addr.arpa {
  primary localhost;
  key DHCP_UPDATER;
}

zone intra.fablabwinti.ch {
  primary localhost;
  key DHCP_UPDATER;
}

subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.100 192.168.1.250;
    
    option domain-name "intra.fablabwinti.ch";
    option domain-name-servers ns1.intra.fablabwinti.ch, ns2.intra.fablabwinti.ch;

    option routers 192.168.1.1;
    option broadcast-address 192.168.1.255;
    
    default-lease-time 600;
    max-lease-time 7200;
}

Leave a Reply

Your email address will not be published. Required fields are marked *