dhcpd.conf: three small nuisances
Peter Rabbitson
rabbit at rabbit.us
Wed Jan 17 12:18:04 UTC 2007
Hello,
I have a couple of questions about dhcpd. I got the things to work, but
I don't really like my workarounds, hence the questions:
I am trying to make my dhcpd the central configuration place for both
dhcp and internal dns records. This rules out host declarations, as they
have no mechanism to cleaning out a zone once the fixed-address changes.
Also most computers are identified by their option host-name (yes, I
know what the man page says). A solution I came up looks like this:
...
class "cc-ups1" {
match if option host-name = "cc-ups1";
}
pool {
range 192.168.58.30 192.168.58.30;
default-lease-time 86400;
min-lease-time 60;
max-lease-time 172800;
ddns-hostname = "ups1.lan.domain.com";
allow members of "cc-ups1";
}
class "cc-ups2" {
match if option host-name = "cc-ups2";
}
pool {
range 192.168.58.31 192.168.58.31;
default-lease-time 86400;
min-lease-time 60;
max-lease-time 172800;
ddns-hostname = "ups2.lan.domain.com";
allow members of "cc-ups2";
}
class "00:0a:e6:e9:91:72" {
match if binary-to-ascii (
16,
8,
":",
substring (hardware, 1, 6)
)
= "0:a:e6:e9:91:72";
}
pool {
range 192.168.58.66 192.168.58.66;
default-lease-time 86400;
min-lease-time 60;
max-lease-time 172800;
ddns-hostname = "station3.lan.domain.com";
allow members of "00:0a:e6:e9:91:72";
}
pool {
range 192.168.58.128 192.168.58.191;
default-lease-time 900;
min-lease-time 60;
max-lease-time 1800;
ddns-hostname = concat (
pick-first-value
(option host-name, "unknown"),
"-",
binary-to-ascii (10, 8, "-", leased-address),
".unknown.lan.domain.com"
);
deny members of "cc-ups1";
deny members of "cc-ups2";
deny members of "00:0a:e6:e9:91:72";
...
}
...
This does exactly what I want but has a couple of shortcommings
(besides being bulky, but I wrote myself a config generator).
* In order to match the hardware value I need to strip leading zeroes
from the string I am matching against. Is there any way to deal with
this?
* As many declaration might have a different ddns-hostname domain, I am
supplying FQDNs directly to ddns-hostname. However I must specify
ddns-domainname ""; which forces concatenation of the empty sting with a
dot inbetween thus resulting in a real FQDN. Is there a way to disable
consulting ddns-domainname altogether? Another way would be to
dynamically update ddns-domainname before every declaration much like
BINDs $ORIGIN, but since I have FQDNs at hand I would like to avoid it.
* For my dynamic pool I want to see the computername that the client
sent, hence the pick-first-value (option host-name, "unknown"). However
if the windows computer name contains an underscore character not
allowed in DNS the update will fail. It is a minor nuisance but is
there any way around it?
Thank you in advance for your great help.
Peter
More information about the dhcp-users
mailing list