The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

Article Feedback - connecting to the network
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 dhclient
Author: solis 
Date:   26-08-02 05:17

Ok, it is absolutely frivolous to post this, but perhaps someone may find it useful.

dhclient supports a number of hooks that control how the script interacts with the rest of the system, in this case, we wish to negate the adverse effects of rewriting /etc/resolv.conf everytime dhclient works it voodoo.

man dhclient-script for more info.

Anyways, create your resolv.conf then do this:


# vi /etc/dhclient-enter-hooks

make_resolv_conf() {
echo "doing nothing to resolv.conf"
}

# chmod 500 dhclient-enter-hooks
# chmod +x dhclient-enter-hooks
# killall dhclient
# dhclient interface

now you will notice that dhclient will reassuringly notify you that it is "doing nothing to resolv.conf".


And that's it!


Cheers!

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org