Am Sun, Aug 06, 2023 at 05:17:23PM +0800 schrieb Jon Smart: Hi Jon, > 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? > I am not sure about the details. But with DHCP a bunch of network configuration items can be send from the server to the client. The nameserver configuration is one of the items.
Kind regards, Christoph > > > > > 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. > > > > -- Ist die Katze gesund schmeckt sie dem Hund.
signature.asc
Description: PGP signature