I want to set up DNS Servers for any type of connection (wi-fi, wired, tethering USB) on my computer (Lenovo Thinkpad E16 Gen 2) running Fedora 44 KDE.
I know this could be done from each network’s , but since I travel for work, I connect to a wide variety of different networks.
I’ve read about various solutions online, but I’d like to play it safe.
Since you move between so many networks, set the servers once in NetworkManager’s global DNS config, which overrides the DNS on every Wi-Fi, wired, and USB tethering connection. Create /etc/NetworkManager/conf.d/90-global-dns.conf with the two lines below, replacing the addresses with the servers you want.
Then run sudo systemctl restart NetworkManager and check that resolvectl status lists your servers. Captive portal login pages on public Wi-Fi often only load with the network’s own DNS, so comment out the servers line and restart NetworkManager when one of those won’t open.