stop updating resolv.conf on DHCP

Rashkae ubuntu at tigershaunt.com
Fri Jul 13 22:36:07 UTC 2012


On 07/13/2012 03:40 AM, Florin Andrei wrote:
> Multihomed server, external interface on DHCP, internal interfaces with
> fixed addresses. Server is running its own DNS resolver with Bind. So
> there's no need to update resolv.conf via the DHCP client.
>
> I tried this in /etc/network/interfaces:
>
> auto eth2
> iface eth2 inet dhcp
> dns-nameservers 127.0.0.1
> dns-search home.local
>
> But then the DNS servers and domain provided by DHCP are still added to
> resolv.conf in addition to my own. I want to stop that altogether.
> resolv.conf must contain only my own DNS server and domain.
>
> Is there a way to do this nicely, only relying on config scripts, or do
> I have to do it the hard way, modifying system scripts? (which would suck)
>
> I can't believe there's no obvious solution to this simple problem. On
> Red Hat, I would just add PEERDNS=no to the interface config and the
> problem would be solved. :(
>

You have to configure dhcp with /etc/dhcp/dhclient.conf

Of interest to you would be to uncomment the #prepend 
domain-name-servers 127.0.0.1;

You can also remove domain-search, domain-name and domain-name-servers 
from the request parameter.







More information about the ubuntu-users mailing list