DNS questions - WORK

Kurt Granroth plug-discuss at granroth.org
Fri Jan 20 22:29:39 MST 2006


On Jan 20, 2006, at 8:16 PM, Jerry Davis wrote:
> I am installing linux for one of our servers.
> I am a real novice when it comes to networking issues.
>
> I know conceptually what DNS is.
> I also know what the ip address of our DNS server is at work.
> I also know that we use DHCP.
>
> All I have ever done at home is manipulate the /etc/hosts files.
> What we want to do is use the DNS Server at work. So that no matter  
> what our
> address becomes when booting up, all the other hosts will know  
> about our new
> address.
>
> So how do I set up our linux box, to resolve to the DNS Server, and  
> use DHCP,
> and if the address changes how does the DNS Server know about it?

This is a very common problem.  You have at least three options to  
solve it:

1. The canonical case is to use BIND for DNS and write a custom  
dhcpd.exe script.  Most dhcp clients will allow you to run a script  
(typically called dhcpd.exe) after it gets an IP.  You can use this  
script to run some nsupdate commands to update BIND with the new  
address.  We did this for a year or so at work and it worked  
relatively well.  BIND is no fun, though, so we ditched that solution  
as soon as we could.  It is THE official way to handle this  
situation, though, and may be your only way if you don't control the  
DHCP server.

2. If you do control the DHCP server, then you can configure it to  
give each host the same IP every time.  This is based on MAC  
address.  Since each host always gets the same IP address, you can  
safely put it into DNS or your /etc/hosts files

3. If you'd prefer not to use BIND (and I wouldn't blame you), I  
would suggest dnsmasq.  dnsmasq is trivial to setup and works great.   
It can do just DNS or, if you prefer, can also take care of DHCP.  If  
you let it take care of DHCP, then it will automatically add the IP  
addresses of the new hosts to DNS when they register.  In any case,  
configuring dnsmasq is as easy as setting up /etc/hosts with all of  
the right IP addresses on whatever system dnsmasq runs on.

I would only do #1 if you don't control the DHCP server.  If you do  
(or can) control it, I would do #3.  #2 is okay if you have some odd  
problem with dnsmasq.

Give the word if you are more interested in #1 and I'll dig up the  
update script that we used.

Kurt 


More information about the PLUG-discuss mailing list