When my CentOS virtual machine boots it uses DHCP to get an IP address. It also overwrites resolv.conf with the DNS settings provided by the DHCP server. The DHCP server doesn't supply any search domains so I would like to get dhclient to put in a list of search domains when it writes it. How can I configure dhclient to do this?
|
feedback
|
|
I managed to work this out in the end. I added a line like the following to
| |||
|
feedback
|
|
Also you can add string to /etc/dhcp3/dhclient.conf like this
*EDIT: this method works with Debian Lenny and Squeeze too | ||||
|
feedback
|
|
On CentOS 6, I'm using the following file to add my preferred DNS search domain:
This file is the first that's checked for in
See also http://serverfault.com/questions/231076/configuring-dhcp-on-rhel-6 | |||
|
feedback
|
|
The /etc/dhclient-eth0.conf answer above didn't work for me. I don't have an /etc/dhcp3 directory so I didn't think that was likely to work either. After examining the /sbin/dhclient-script file (which creates /etc/resolv.conf on my Centos 5.6 system), I added the SEARCH line below to /etc/sysconfig/networking/devices/ifcfg-eth0:
Then:
| |||
|
feedback
|
