[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dhcpclient overwrites /etc/resolv.conf



On Wed, Oct 16, 2013 at 01:52:10PM +0000, Bonno Bloksma wrote:
> Hi,
> 
> I thought I had it covered but it seems I was wrong.
> 
> My uplink uses DHCP to give me my ip-number etc. It also gives me the dns server for the uplink but... I run my own dns servers(s) for our local domain.
> I want the /etc/resov.conf file to stay as it is and not be overwritten by the dhcp client service.
> Just doing a chmod -w /etc/resolv.conf is not enough.
> 
> How can I accomplish this?

Several ways - not necessarily mutually exclusive:

(1) Get your own local domains into the global DNS ? If it is a domain
you own, you can nominate yourself in the DNS. The upstream name
servers will go back and ask your name servers and things "should just
work".

(2) In /etc/dhcp/dhclient.conf  add:

    prepend name-servers 1.2.3.4;

or similar.

(3) Install the "resolvconf" package and update
/etc/resolvconf/resolv.conf.d/head - this file is the top "fragment"
of the (now generated) /etc/resolv.conf file

There may be other ways I cannot think of off the top of my head

Hope this helps

-- 
Karl E. Jorgensen


Reply to: