DNS, DHCP, or both?



  • If I have a local device where I want to allocate a static IP and a fixed host name, I can do this in two ways (3 if you include BIND, but I'm excluding BIND here as overkill for a small LAN).  I can allocate a static IP in DHCP, so when the device requests an IP and authenticates to the LAN, it gets a given static IP. I can also add the device to the list of hosts In Unbound config, so that when other devices look it up by name, they can find its IP as well.

    Do I have to define the machine's relationships twice here (in DHCP to map MAC -> IP, and in Unbound to map Name -> IP), or is there a way to do it once only?

    I'm thinking here of the potential down the line to change one of these but not the other, or change the NIC and then spend ages wondering what broke, when they're out of sync and I start getting occasional problems. Much better to define it just once, if there is a way. Is there?



  • In DNS Forwarder and DNS Resolver, there's an option called "DHCP Registration"

    DHCP Registration

    Register DHCP leases in the DNS Resolver

    If this option is set, then machines that specify their hostname when requesting a DHCP lease will be registered in the DNS Resolver, so that their name can be resolved. The domain in System > General Setup should also be set to the proper value.

    You only need to set host names in your DHCP reservations.


  • Banned

    if you only have a small LAN then i'd recommend doing it in both places and not registering DHCP leases.

    It is generally preffered not to use that option unless you need it.

    If you have hundreds+ clients then it's probably not worth it, but for a normal home it's probably worth the time just to type it in.

    I think Unbound reloads every time a new DHCP is registered? Hopefully someone else can confirm or deny that.



  • @pfBasic:

    I think Unbound reloads every time a new DHCP is registered? Hopefully someone else can confirm or deny that.

    Also more to the point, if reloaded, is its cached data lost or service interrupted? That would be an important point for some networks. Samba for instance reloads config without stopping+starting.