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

Re: /etc/resolv.conf changes every booting time



Am Sun, Aug 06, 2023 at 09:28:55AM +0800 schrieb Jon Smart:

Hi Jon,

> I have removed the default systemd-resolved local dns service following
> the link below,
> 
> https://askubuntu.com/questions/907246/how-to-disable-systemd-resolved-in-ubuntu
> 
> And I have unbound installed and enabled as local DNS server.
> 
> But every time I reboot the server, the configuration file
> /etc/resolv.conf changes to a default one. So every time I have to update
> its content to:
> 
> nameserver 127.0.0.1
> 
> (points to unbound)
> 
> How to stop the auto-changes to /etc/resolv.conf after rebooting?

In case you get the configuration overwritten by DHCP you can avoid that
by the following lines in /etc/dhcp/dhclient.conf.

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

Just replace the interface name with yours.

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

Attachment: signature.asc
Description: PGP signature


Reply to: