Setting Classes Based on Domain Name

Martin McCormick martin at dc.cis.okstate.edu
Mon Mar 12 14:29:02 UTC 2007


	This should be trivial, but somehow, I am not thinking
along the right path.  Let's say there are several static entries
defined to dhcpd via omapi such that a record looks like:
host pascal.zlabs.example.domain {
  dynamic;
  hardware ethernet 0f:80:08:37:7f:0f;
  fixed-address 10.9.8.7;
}

	When this guy shows up in the dhcp server, I know his
name is pascal.zlabs.example.domain and he belongs in a class
called zlabs along with any other system whose domain name is
zlabs.example.com.  That may be all they have in common and they
will most likely send nothing or their individual computer name
to dhcpd so the only thing to match against is in the lease
record or possibly a DNS lookup match if that is possible.
Here's what I am thinking:

class "zlabs" {
if suffix (option host-name, 20) = "zlabs.example.domain" {
option domain-name-servers 192.168.1.1,192.168.1.2;
}
}

	I believe that host-name is actually a string you get
from the client so I was just hoping against hope this might
also match the defined name.:-)  Actually, the host name never
gets sent or received in this transaction, but it is known so it
should be testable.

	In the actual test environment, the system does boot but
gets the default domain name servers so is obviously not
matching the class.


Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Network Operations Group


More information about the dhcp-users mailing list