Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Get DHCP options except for 'foo'

    'lo all!

    Short Question: How can I continue to use DHCP, but refuse to apply certain DHCP options in favor of options that I manually configure on the client computer?

    Backstory: I'm using Debian 4 with Gnome on a Dell Dimension e310. I'm running dhcp-client 3.0.4-13. What I'd like to do is continue to get DHCP options with the exception of the DNS servers. I've set up this same functionality on Windows machines many times. Here's what I've bungled around with so far on my Linux box:

    I've changed the resolv.conf file to use the DNS server of my choice, but of course the DHCP client overwrites that info whenever a renew occurs. Someone said that I could just put the "immutable flag" on the file (whatever that means... I have yet to Google that one) but that seems to be a rather heavy handed "solution".

    I thought that the 'request' and 'require' options in the dhclient.conf file might be of use. I removed the domain-name-server entry under both 'request' and 'require'. That didn't give me what I was after; I still received DNS servers from the DHCP server which overwrite any manual changes I made to the resolv.conf file. I see now that editing the 'require' section wouldn't help me, but I'm still not sure why editing the 'request' section didn't work.

    Someone mentioned that I may have to frob around with dhcpd or dhclient to get this to work. dhcpd isn't on this box though. I've begun to slog through the man pages but thought I'd simultaneously send up a call for help here.

    What's even more frustrating is that I've tried to use Gnome Network Admin control panel to change my interface from DHCP to Static. Everything looks like it works, and I even go to the DNS tab of the Network Admin CP and remove the old DHCP acquired DNS servers and replace them with the one that I want. However, after closing the CP it reverts right back to the former DNS servers that were acquired through DHCP even though the properties box for that interface shows it as being 'static'. NOTE: I 'fixed' that behavior. It seems that Gnome's Network Admin CP dosen't like more than one thing being edited between clicking 'okay'. E.g. I'll change eth0 to be static and then have to click 'okay' before re-opening Network Admin to delete the DNS servers and add the proper on in. Weird. That's a whole 'nuther problem I suppose.

    Thanks for your attention,

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    The Keystone State
    You could just set the resolve.conf to read-only 444.
    I know this is not the best solution but it should work.


    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts