On Sun, Aug 6, 2023 at 6:13 AM Jon Smart <j...@daydaylive.us> wrote:
> It's a VPS provided by a local ISP. The VPS has a static IPv4. > Do you know how to know if /etc/resolv.conf is modified by dhcp? > > Thanks. > > > > > > 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 > The file /etc.resolv.conf is just a soft link. You need to: 1: Delete /etc/resolv.conf - rm /etc/resolv.conf 2: Create a new /etc/resolv.conf file: touch /etc/resolv.conf 3: Configure you nameservers 4: Make the file immutable: chattr +i /etc/resolv.conf > >> > >> (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. > > > > > -- ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/ ⠈⠳⣄⠀⠀c