[plug] Server name

Craig Ringer craig at postnewspapers.com.au
Mon Jun 23 13:09:15 WST 2003


>
>
>>| Plus, you'll want the "use-host-decl-names on;" flag set (probably in 
>>| the subnet or global level) to ensure that the declared hostname is sent 
>>| to the DHCP client, instead of having to also declare "hostname blah" 
>>| for each host.
>>
>>Hmm.  I have this switched on, but I've never been entirely sure what it
>>does or whether/why it should be needed.  Would you mind elaborating
>>a bit in the interests of curing my ignorance?
>>
>And you lost me at "Plus ....."
>
>Where does (which file) "use-host-decl-names on;" get set?
>
>Also, is this getting the information from dhcp or telling it
>that you want to set it to this address?
>
OK. The file you configure dhcpd with is usually /etc/dhcpd.conf 
(sometimes /etc/dhcp/dhcpd.conf). This is where all the configuration 
goes. "man dhcpd.conf" will give you a good rundown on this file. 
Essentially, you can make settings that affect all hosts and networks 
that dhcpd serves, or you can make settings that affect only a specific 
network, specific subnet, or even just one host. For example, if you 
have a different gateway on the network "192.168.1.0/24" to the network 
"192.168.0.0/24", you can simply define the gateway setting in the 
network-specific section of the file and hosts on each subnet get sent 
different gateway addresses.

That specific setting, "use-host-decl-names" is defined in the 
dhcpd.conf man page. DHCP can be used to send a /lot/ more than IP 
addresses - you can tell hosts what their default gateway should be, 
what their hostname is, or even what server from which to mount their 
root directory over NFS (if they support this). This specific setting 
tells the dhcp server that instead of not sending any hostname if you 
don't define a specific hostname for each static IP, it should 
automatically use the name you give the host in it's host declaration in 
dhcpd.conf as the hostname to send.

So,

use-host-decl-names on;
.....
host erdos {
  hardware ethernet 00:80:AD:76:35:7D;
  fixed-address 192.168.0.2;
}

will tell the host with the above MAC address that it's hostname is 
"erdos" in the DHCP reply, and is essentially the same as:

host erdos {
  hardware ethernet 00:80:AD:76:35:7D;
  fixed-address 192.168.0.2;
  hostname "erdos";
}

I strongly suggest you read the documentation on dhcpd and the 
dhcpd.conf file - they are not hard to follow, and are very informative.

Craig Ringer



More information about the plug mailing list