Hello #linux experts.
I am struggling with trying to stop my #Debian Trixie server from obtaining it's DNS resolver from DHCP.
I edit `/etc/resolv.conf` to use my preferred DNS resolver and I add `supersede domain-name-servers 192.168.1.2` to `/etc/dhcp/dhclient.conf` and then renew my DHCP lease, which results in the preferred DNS resolver being used for a while until `/etc/resolv.conf` is overwritten again. What am I doing wrong, please? Thank you!!
There's no desktop, so NetworkManager is not involved, nor is system-networkd, so I can't understand what is overwriting resolv.conf. I am tempted to install dnsmasq and be done with it, but it irks me that I cannot simply stop the server from obtaining the DNS resolver from the router/gateway on my home network. I would rather use my preferred DNS resolver than my ISP's....
@pocketlint nmcli is a thing, networkmanager isn't tied to a gui
@pocketlint I use it on my headless Pi. Saves hacking at config files
@falken Thanks, I might well do that.
I wanted to keep things with as few moving parts as possible, hence my preference for messing with the config files on this Debian server, but I see the benefit of using NetworkManager.
Indeed, I used it recently on a different device to stop it obtaining DNS over DHCP and it worked very well.
BTW : I don't have a weird perversion for forcing devices not to use DHCP for DNS! I happened to need a script to change DNS resolver when roaming on a VPN...