DHCP ddns-domainname : Dynamically select domain name based on the subnet.
tomkcpr at mdevsys.com
Fri Mar 15 06:15:20 UTC 2019
Is there a way to dynamically register host names with the DNS server
(named) based on the subnet from which the client got the IP?
Let's say I have the following subnets defined in DHCP + DNS (named)
that in turn all run on a single VM that has 3 NIC's:
1) 18.104.22.168/24 ( VLAN 123 ) eth0
2) 22.214.171.124/24 ( VLAN 124 ) eth1
3) 126.96.36.199/24 ( VLAN 125 ) eth2
And I've configured my DNS server authoritative for the following domains:
When using ddns-domainname, I can automatically register each new client
with the DNS however I can only select a single domain using option:
What I want to achieve is the following:
1) Clients that are configured on subnet 1) should be dynamically
updated in the DNS using domain <HOST>.a.dom.abc .
2) Clients that are configured on subnet 2) should be dynamically
updated in the DNS using domain <HOST>.b.dom.abc .
3) Clients that are configured on subnet 3) should be dynamically
updated in the DNS using domain <HOST>.c.dom.abc .
So if I build a CentOS 7 machine on subnet 2) [188.8.131.52/24] and give it a
hostname such as new-host01, then the DHCP should update the DNS with
new-host01.b.dom.abc A 184.108.40.206
How could I achieve this via the DNS / DHCP server configuration?
I can configure the clients with a custom script in /etc/dhclient.conf
and use the option:
server fqdn.fqdn <CLIENT FQDN>
however that is more of a hackish solution and not very flexible at all,
involving customization of clients, templating etc.
More information about the dhcp-users