dhclient overwriting resolv.conf

Home Page Forums Network Management Signal a BUG dhclient overwriting resolv.conf

This topic contains 2 replies, has 0 voices, and was last updated by  fish 10 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #41437

    fish
    Member

    I want my resolv.conf to look like this so all services running in Zeroshell use the local named daemon:

    root@zeroshell isolinux> more /etc/resolv.conf
    search example.com
    nameserver 127.0.0.1

    The IP of my WAN interface is assigned via DHCP. After dhclient does it’s thing, my resolv.conf looks like this:

    root@zeroshell isolinux> more /etc/resolv.conf
    search woh.rr.com
    nameserver 65.24.7.10
    nameserver 65.24.7.11

    As a result, queries through the local resolver (HAVP) do not get routed through the local named daemon, nor the forwarders I have set (OpenDNS for content filtering). Things are not working right.

    Putting this in dhclient.conf prevents resolv.conf from being overwritten:

    supersede domain-name “example.com”;
    supersede domain-name-servers 127.0.0.1;

    Though my doofus self can’t figure out how to make it persistent across reboots (the whole isolinux/ramdisk thing).

    Thanks.

    #47534

    fish
    Member

    I added these two lines to my post-boot script:

    echo “supersede domain-name “example.com”;” >> /etc/dhclient.conf
    echo “supersede domain-name-servers 127.0.0.1;” >> /etc/dhclient.conf

    but it seems that dhclient as already done it’s thing by the time the post-boot script runs. This solves any further DHCP lease renewal issues but doesn’t get it before the client obtains a lease on boot.

    Putting these two lines in the pre-boot script doesn’t seem to do anything.

    How do I make this persistent?

    #47535

    imported_fulvio
    Participant

    Please, just put the following command in the Pre Boot script:

    chattr +i +d /etc/resolv.conf

    Regards
    Fulvio

    #47536

    fish
    Member

    That got it done.

    Thanks Fulvio!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.