Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DNS and DHCP 3

Status
Not open for further replies.

BIS

Technical User
Jun 1, 2001
1,893
NL
Hallo All,

Sorry to post this, but my head seems lost today.

Say I boot a box with DHCP, it works and I get an ip address. Will I also get DNS server information, and if so where is this stored? I have hard coded the DNS in resolv.conf, just wondering if DHCP will overwrite this? Or, if I comment out the DNS servers in resolv.conf, where would the DNS be coming from?
 
You have to specify option domain-name-servers w.x.y.z; in your dhcpd.conf. I've never had to specify anything in resolv.conf.


--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
I think the more complete description is that if, as zeland says, you INCLUDE DNS servers in your DHCP server config, then that information will be distributed to clients during lease renewal.

However, Windows and Linux clients can specify the DNS locally (i.e. resolv.conf) and I believe these values trump any DNS supplied by DHCP. I do this all the time for a variety of reasons such as testing or using a preferred resolver.

Internet Directory
 
Many thanks all.
Just tried to comment out everything in resolv.conf, then rebooted for the hell of it. Now reslov.conf is populated by nameserver x.x.x.x but at the top of the file it states:
; generated by /sbin/dhclient-script
Using these DNS servers in the windows client (fixed ip) works as well.
 
It looks like you are talking about a dhcp client not a dhcp server. So editing the dhcpd.conf will be of little use. The dhclient script populates your resolv.conf, unless you hard code it. Also, if you want your hostname to be sent to the dns server add the following to your ifcfg-eth[X], DHCP_HOSTNAME=""



>---------------------------------------Lawrence Feldman
SR. QA. Engineer SNAP Appliance
lfeldman@snapappliance.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top