How can DNS setting be changed across all networks? it is easy to change on a per wireless network basis using Gnome Network Manager on any desktop environment, but DNS has to be set for every wireless network separately.
Wouldn’t it be easiest to change it in your router settings?
Change DNS in router instead!
Travel a lot and ISP router cannot change DNS anyways. Could install IPFire or Pi-hole or install a Tomato router behind ISP router or something (and have done all in the past) but just want to keep this simple. Am looking to just change DNS on a single machine for all wireless networks at once (one, and only one, thing Windows does better than Linux.)
Windows better than Linux … .
Add up to three nameserver(s) to
/etc/resolv.conf, e. g.
sudo sh -c 'printf "nameserver 188.8.131.52\nnameserver 184.108.40.206\n" > /etc/resolv.conf'
Optionally protect your
/etc/resolv.conffrom being modified by setting the immutable (write-protection) attribute
sudo chattr +i /etc/resolv.conf
- Check which servers are used with
dig, e. g.
On Debian resolv.conf is a symlink to /etc/resolvconf/run/resolv.conf
If this is the case I don’t think the above would work. Will check if this is the case on Arch and post again after checking.
Don’t do that.
You’re right, this should be the preferred way of preventing NetworkManager from changing the configuration, -but- this will only stop
NetworkManager from modifying
I admit the chance being slim but various other processes and applications, for instance
netctl, could still overwrite
/etc/resolv.conf. That’s why I personally think write protecting
/etc/resolv.conf is still a viable solution if you want to prevent it from being modified by anything.
For me it’s so much easier to edit resolv.conf manually, then write protect with the
+i flag and undo with the
-i flag if need be.
Isn’t it nice to have options?