dhclient and your resolv.conf

I use a custom search domain (so I don't have to type out web-ster.com) to save me a lot of typing. The problem is that everytime I DHCP (or renew) it overwrites my /etc/resolv.conf with whatever the DHCP options are. I finally found a way to append on the search domain in Fedora. Simply create a file /etc/dhclient-exit-hooks file with these contents

echo "search web-ster.com" >> /etc/resolv.conf
Leave A Reply - 4 Replies
Replies
jbeez June 23rd 2006

Or you can fix it properly by editing dhclient.conf and adding a supersede or prepend statement.

man 5 dhclient.conf ftw

jbeez sucks May 30th 2007

tried that b4 jbeez, fedora happily ignores that shit - you rock, man who posted this real working solution

xxx October 25th 2011

vi /etc/sysconfig/network-scripts/ifcfg-eth0 SEARCH="example.com sub1.example.com sub2.example.com"

xxx October 25th 2011
All content licensed under the Creative Commons License