[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DHCP and host names



On Sat, Aug 18, 2001 at 09:34:20AM +0200 or thereabouts, Erik van der Meulen wrote:
> Hi, I have managed to change my LAN from fixed IP to DHCP. I had somehow
> expected the DHCP software to update my /etc/hosts file, so I would
> still be able to ping hostname. In practice, this does not seem to work.
> Now it seems that I have given up a little functionallity in the change
> to DHCP. I do not find this addressed in the DHCP mini-howto.
> 
In order to use dhcp and have it update dns, you need to use a dns server.
I did this exact same thing with isc dhcpd and bind.  It will take a little
work, but if you are into learning, it will be fun.  See the bind howto for
setting up the dns server.  There are some security things to keep in mind.
If the dns server is only for your LAN, be sure that it only responds to 
queries coming from your LAN, and block incoming requests to it.
Once that is done, you can do this in /etc/dhcpd.conf:

# your domain name
option domain-name "foo.cxm";

# this updates /etc/resolv.conf for the clients.  Put your dns server first, 
# so lookups are made there
option domain-name-servers <lan_dns_server_ip>, <isp_dns_server_ip>, <isp_dns_server_ip>;

# dynamically assigned clients
subnet 192.168.2.0 netmask 255.255.255.0 {
         # not used yet
         range 192.168.2.50 192.168.2.127;
}
The last stanza id what ip's clients get.  Now if you want these integrated with
dns, then in my experience you have to 1) create the entries in your dns 
configuration and 2) make sure the dns server has a static ip so that we can 
find it.  You can have dhcp hand out a static ip based on a MAC address if
you are so inclined.

I did not put all the dhcp options in there, only the ones to get it to work
with dns.  Hope this helps; it has been working on my LAN for over a year
with no problems.

Jamie Strandboge

-- 
"The goal of Computer Science is to build something that will last at
least until we've finished building it."  -- Author unknown

Email:                  jstrand1@rochester.rr.com
GPG/PGP Public Key ID:  26384A3A
GPG/PGP Fingerprint:    D9FF DF4A 2D46 A353 A289  E8F5 AA75 DCBE 2638 4A3A



Reply to: