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

Re: how to change default nameserver?



After you edit resolv.conf make the file immutable with chattr. Chattr +i makes immutable chattr -i removes immmutable.

On April 9, 2023, at 4:51 AM, Christoph Brinkhaus <c.brinkhaus@t-online.de> wrote:

Am Sun, Apr 09, 2023 at 04:20:49PM +0800 schrieb coreyh@free.fr:
> greetings,
> 
> I know I can edit the entries in /etc/resolv.conf, but it will be
> overwritten by DHCP server.
> I searched the internet and got one of the answers:
> 
> apt install resolvconf
> echo "nameserver 127.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
> 
> what's the difference for /etc/resolv.conf and the method above?
 
There is a thrid method I use. I have add the following lines to
/etc/dhcp/dhclient.conf:

interface "bond0" {
supersede domain-name-servers 127.0.0.1;
}

My interface is bond0. Yours might be different.

Kind regards,
Christoph
-- 
Ist die Katze gesund
schmeckt sie dem Hund.


Reply to: