DDNS with host declarations

Glenn Satchell Glenn.Satchell at uniq.com.au
Sun Oct 29 11:15:42 UTC 2006


>Date: Sun, 29 Oct 2006 10:23:54 +0100 (MET)
>From: Jan Engelhardt <jengelh at linux01.gwdg.de>
>To: dhcp-users at isc.org
>Subject: Re: DDNS with host declarations
>
>
>>>when dhcpd.conf contains a host declaration, such as
>>>
>>>   host foobar {
>>>       fixed-address 192.168.234.2;
>>>       hardware ethernet 00:aa:bb:cc:dd:ee;
>>>   }
>>>
>>>then no DDNS update takes place at all. How can I achieve that
>>>
>>>   (a) DDNS updates are made, according to a fixed hostname (set in
>>>   dhcpd.conf)
>>
>>'man dhcpd.conf' - look for update-static-leases
>>
>>Be aware that in either case, the dhcp server will do a DNS update 
>>for every lease renewal (because it doesn't have a lease structure to 
>>track it with), and it will not delete the record when the lease 
>>expires.
>
>I see. Defining a 'fixed-address' will make it not have a lease struct.
>That's not so good.
>    Is there a way to configure dhcpd to offer the client only one
>(ergo fixed) address by means of
>
>    * offering exactly 192.168.234.2 for a DHCPDISCOVER
>    * DHCPNAK'ing all non-192.168.234.2 DHCPREQUESTs
>
>Then it would have a lease struct too, and a lease expire/DHCPRELEASE 
>could properly trigger a DDNS release.
>    I tried
>
>	host xp {
>	    hardware ethernet putsomethinghere;
>	    range 192.168.234.2 192.168.234.2;
>	}
>
>but it's of course not accepted.

See the section in dhcpd.conf on classes. You can define a single class for each 
host based on the mac address. Then create a pool with a single IP address in 
the range. Something like this:

class "xp" {
  match if hardware = putsomethinghere;
}

subnet 192.168.234.0 255.255.255.0 {
  ...
  pool {
    allow members of "xp";
    range 192.168.234.2;
  }
  ...
}

Which can be quite clumsy if you need to have more than a few hosts
defined this way. An alternative may be to let dhcpd pick the address
and just use a really long lease time such as several months.

group {
  min-lease-time 31536000; # 1 year in seconds
  host xp {
    hardware ethernet putsomethinghere;
  }
  host w98 {
    hardware ethernet ...;
  }
}

and so on.

A new feature in 3.1.0 (still in alpha) that could be used is "reserved
leases", which ensure the same address is offered back to the client.
You may like to search the archives for as there's been a fair bit of
discussion on this new feature.

regards,
-glenn
--
Glenn Satchell     mailto:glenn.satchell at uniq.com.au | Some days we are
Uniq Advances Pty Ltd         http://www.uniq.com.au | the flies;  some
PO Box 70 Paddington NSW Australia 2021              | days we  are the
tel:0409-458-580  tel:02-9380-6360  fax:02-9380-6416 | windscreens...





More information about the dhcp-users mailing list