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
jbeez 2006-06-23 08:38am - No Email - Logged IP:

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

man 5 dhclient.conf ftw

jbeez sucks 2007-05-30 04:39pm - No Email - Logged IP:

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

xxx 2011-10-25 07:58am - No Email - Logged IP:

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

xxx 2011-10-25 08:00am - No Email - Logged IP:
All content licensed under the Creative Commons License