0

I have set up the ISC's BIND and DHCP implementations on an Ubuntu 16.04 VM as an authoritative name server with authoritative DHCP. My goal is to be authoritative about mobile.mydomain.org and int.mydomain.org with a mixture of both static and DHCP addresses.

Here is my named.conf.local:

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

zone "int.mydomain.org" {
        type master;
        file "/etc/bind/zones/db.int.mydomain.org";
        allow-transfer { 192.168.1.3; };
        allow-update { key DHCP_UPDATER; };
};

zone "0.168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/zones/db.192.168.0";
        allow-update { key DHCP_UPDATER; };
};

zone "1.168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/zones/db.192.168.1";
        allow-update { key DHCP_UPDATER; };
};

zone "mobile.mydomain.org" {
        type master;
        file "/etc/bind/zones/db.mobile.mydomain.org";
        allow-transfer { 192.168.1.3; };
        allow-query { 172.16.0.1/22; };
        allow-update { key DHCP_UPDATER; };
};

zone "0.16.172.in-arpa.arpa" {
        type master;
        file "/etc/bind/zones/db.172.16.0";
        allow-update { key DHCP_UPDATER; };
};

Staticly assigned domain names get resolved properly, so no problems there. DHCP addresses get assigned from this dhcpd.conf:

ignore client-updates;

ddns-update-style none;
option domain-name-servers 192.168.1.2, 192.168.1.3;
default-lease-time 60;
max-lease-time 720;
authoritative;
log-facility local7;

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

subnet 192.168.0.0 netmask 255.255.252.0 {
  range 192.168.2.1 192.168.3.250;
  option domain-name-servers 192.168.1.2, 192.168.1.3;
  option domain-name "int.mydomain.org";
  option subnet-mask 255.255.252.0;
  option routers 192.168.0.1;
  option broadcast-address 192.168.3.255;
  default-lease-time 60;
  max-lease-time 720;
}

zone int.reboot3times.org. {
  primary 192.168.1.2;
  key DHCP_UPDATER;
}

zone 0.168.192.in-addr.arpa. {
  primary 192.168.1.2;
  key DHCP_UPDATER;
}

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

zone 2.168.192.in-addr.arpa. {
  primary 192.168.1.2;
  key DHCP_UPDATER;
}

zone 3.168.192.in-addr.arpa. {
  primary 192.168.1.2;
  key DHCP_UPDATER;
}

subnet 172.16.0.0 netmask 255.255.252.0 {
  range 172.16.0.20 172.16.3.255;
  option domain-name-servers 192.168.1.2, 192.168.1.3;
  option domain-name "mobile.mydomain.org";
  option subnet-mask 255.255.252.0;
  option routers 172.16.0.1;
  option broadcast-address 172.16.3.255;
  default-lease-time 60;
  max-lease-time 720;
}

zone 0.16.172.in-addr.arpa. {
  primary 192.168.1.2;
  key DHCP_UPDATER;
}

DHCP address get assigned on request, and I have several VMs deployed with it. Here is an example:

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.2
nameserver 192.168.1.3
search int.mydomain.org

My problem is that I cannot resolve DHCP-assigned addresses. Having read forums and blog posts and articles, my understanding is that I can use a shared key with the DHCP server and the DNS server to allow hostname updates, but that's not working.

How do I dynamically update the DNS server with DHCP-assigned addresses?

  • Recheck whether you really require dynamically assigned addresses in DNS. It's so much easier to use DHCP reservations, so the client always gets the same address that you use statically in DNS. – Zac67 Nov 10 '17 at 7:26
0

You still have ddns-update-style none in dhcpd.conf. The articles you read should have mentioned setting it to interim and also setting ddns-updates on. Take a look at https://wiki.debian.org/DDNS for some decent examples.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.