[NTLUG:Discuss] Hosts using DHCP

Richard Geoffrion ntlug at rain4us.net
Wed Feb 26 21:59:46 CST 2003


On Wednesday 26 February 2003 02:32 pm, Wayne Dahl wrote:

>Since the IP's are subject to change every time the
> machines are rebooted, the entries in the file could be invalid.  I have
> not found any documentation anywhere so far explaining how to get around
> this, short of assigning static IP's.  So, the question is, how does the
> hosts file work on a network where DHCP is running?
>
> Wayne
>
Take the following snippet from a dhcpd.conf file

[snippet]
subnet 192.168.1.0 netmask 255.255.255.0 {
        range 192.168.1.102 192.168.1.140;
        host richardspc {
                hardware ethernet 00:90:27:34:B2:C8;
                fixed-address 192.168.1.210;
                }
        host waynespc {
                hardware ethernet 00:a0:c9:ee:24:5f;
                fixed-address 192.168.1.101;
                }
        }
[/snippet]

IF you have control over the dhcp server you could assign 'permenantly 
assigned' dhcp'ed addresses to the clients and have a relatively static hosts 
file.

Now if we could get DHCPD to update the /etc/hosts file...now THAT would be 
cool.  (Dynamic DNS??)

-Richard



More information about the Discuss mailing list