TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
3.84k stars 400 forks source link

Reserved DHCP Leases Not Automatically Accessible by Hostname #790

Closed jjack closed 7 months ago

jjack commented 7 months ago

Describe the bug

Whenever I add a new reserved lease, it doesn't show up in DHCP > Leases or Zones > $zone until the client actually makes a DHCP request.

This is causing some issues for me because I have a number of devices (namely networking gear) that can't/don't use DHCP and instead use static addresses. I've set Reserved leases for them to make managing/visualizing them much easier, but I'm not able to access them by hostname unless I manually add them to my DNS zone.

Steps to Reproduce

Add a new Reserved DHCP lease to any scope. You won't be able to look up its hostname until it is manually added to Zones > $zone or the client makes a DHCP request.

Newly added DHCP lease "gateway" with a domain name of "local":

jeremy@docker:~$ nslookup gateway
Server:         10.15.0.8
Address:        10.15.0.8#53

** server can't find gateway: NXDOMAIN

jeremy@docker:~$ nslookup gateway.local
Server:         10.15.0.8
Address:        10.15.0.8#53

** server can't find gateway.local: NXDOMAIN

After adding "gateway" to Zones > local:

jeremy@docker:~$ nslookup gateway
Server:         10.15.0.8
Address:        10.15.0.8#53

Name:   gateway.local
Address: 10.15.0.1

Expected Behavior

I'd expect that I would be able to nslookup any reserved DHCP lease, not just those that have been obtained.

ShreyasZare commented 7 months ago

Thanks for the detailed post. This is by design. The reserved lease is not valid until a client has acquired it. There are a few conditions when a client may fail to get the reserved leases which is why it needs to be assigned first to be listed as a valid lease. Only then can the DHCP server make DNS entries for it.

In your case, since you have the devices assigned IP address statically, you do not need to have reserved lease for them. Instead, just make manual DNS entries for those devices. It would also be best to have a small range of IP addresses in you subnet excluded in the DHCP scope so that those IP addresses are not allocated dynamically by the DHCP server and then assign static IP address for the devices you have in that range.

jjack commented 7 months ago

Thank you for the insight and information! I was hoping to keep everything in the Leases tab for the sake of keeping things organized visually.

I'll just make manual DNS entries for them as you suggest.

Thanks again!

ShreyasZare commented 7 months ago

You're welcome!