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

Re: Resolving hostnames using DHCP



On Sun, 2003-04-06 at 11:39, Clive Menzies wrote:
> However, is there a way in which the server can resolve hostnames to 
> local IP addresses automatically or do I really have to list them 
> manually in /etc/hosts?

If you want to do this automatically with DHCP, you can use a feature
called dynamic DNS.

To do this, ensure that you're using at least DHCP server version 3 and
BIND server version 8.

Add the following lines to /etc/dhcp3/dhcpd.conf:
ddns-update-style interim;
option domain-name-servers <your server's IP address>;

Add the folling lines to /etc/bind/named.conf:
zone "<your network address backwards>.in-addr.arpa" IN {
	type master;
	file "db.<your network address>";
	allow-update { localhost; };
};
zone "<your local domain name>" IN {
	type master;
	file "db.<your domain name>";
	allow-update { localhost; };
};

And restart your DHCP and DNS servers:
/etc/init.d/bind restart
/etc/init.d/dhcp3-server restart

This is really neat, but I've been unable to get it working on my Debian
box (whilst it works very nicely on my Red Hat box).

For more information, do a Web search for dynamic DNS.

Hope this helps

-- 
Michael Wardle <michael.wardle@adacel.com>
Adacel Technologies



Reply to: