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

Re: how to change default nameserver?



On 4/9/23 05:05, Timothy Butterworth wrote:
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.


That got changed in my install of bullseye. It might work to add that as a final stanza by copy/pasting the buster version, but its not been tried with bullseye, by me.

Kind regards,
Christoph

Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/>


Reply to: