Skip to main content

Force DNS change.

In my case, /etc/resolved.conf was a symlink pointing to /run/systemd/resolve/stub-resolv.conf. I could edit both but they reverted to default after a reboot.

So I did cp "/etc/resolv.conf" "/etc/resolv.conf_ORIGINAL" And edited it to my liking. For example:

#nameserver 127.0.0.53
nameserver 94.140.14.14#adguard
nameserver 94.140.15.15#adguard
options edns0 trust-ad
search .

Then I chattr +i /etc/resolv.conf to prevent any unwanted modification.
To undo, just chattr -i /etc/resolv.conf

Install dig to check:
sudo apt install dnsutils
dig google.com