DHCP ddns-domainname : Dynamically select domain name based on the subnet.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DHCP ddns-domainname : Dynamically select domain name based on the subnet.

TomK
Hey All,

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?

DETAILS
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) 5.5.1.0/24  ( VLAN 123 ) eth0
2) 5.5.2.0/24  ( VLAN 124 ) eth1
3) 5.5.3.0/24  ( VLAN 125 ) eth2

And I've configured my DNS server authoritative for the following domains:

1) a.dom.abc
2) b.dom.abc
3) c.dom.abc

When using ddns-domainname, I can automatically register each new client
with the DNS however I can only select a single domain using option:

ddns-domainname

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) [5.5.2.0/24] and give it a
hostname such as new-host01, then the DHCP should update the DNS with
the entry:

new-host01.b.dom.abc A 5.5.2.13

for example.

How could I achieve this via the DNS / DHCP server configuration?

--
Thx,
TK

PS:

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.
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP ddns-domainname : Dynamically select domain name based on the subnet.

Simon Hobson
TomK <[hidden email]> wrote:

> 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?
>
> DETAILS
> 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) 5.5.1.0/24  ( VLAN 123 ) eth0
> 2) 5.5.2.0/24  ( VLAN 124 ) eth1
> 3) 5.5.3.0/24  ( VLAN 125 ) eth2
>
> And I've configured my DNS server authoritative for the following domains:
>
> 1) a.dom.abc
> 2) b.dom.abc
> 3) c.dom.abc
>
> When using ddns-domainname, I can automatically register each new client with the DNS however I can only select a single domain using option:
>
> ddns-domainname
>
> 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 .

That will happen automagically if you define ddns-domainname within each subnet declaration. Along these lines :

subnet 5.5.1.0 ... {
  ...
  ddns-domainname a.dom.abc ;
}
subnet 5.5.2.0 ... {
  ...
  ddns-domainname b.dom.abc ;
}
subnet 5.5.3.0 ... {
  ...
  ddns-domainname c.dom.abc ;
}

When a client requests a lease, it will automagically be associated with the appropriate subnet, and will be given the options that are in-scope for that subnet. So in this case, the ddns-domainname will come from the value defined in that subnet, over-riding any global declaration. The inheritance chain would go global scope -> shared subnet -> subnet -> pool and an option can be re-defined in any of those scopes. This makes it easy to define most options globally, and over-ride them for specific subnets or even pools.

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users