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?
|
None of those worked, but the last one was the closest. For Red Hat 6, Use I modified the file and changed
to
and it all worked. |
||||
|
|
|
I managed to work this out in the end. I added a line like the following to
|
|||
|
|
|
Also you can add string to /etc/dhcp3/dhclient.conf like this
*EDIT: this method works with Debian Lenny and Squeeze too |
||||
|
|
|
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 |
|||
|
|
Add to the dchp server conf (isc dhcpd):
Where domain1.com,etc.. are the domain suffixes you want added to the resolv.conf file on each client. |
|||
|
|
|
The After examining the
Then:
|
||||
|
|