Skip to content

Instantly share code, notes, and snippets.

@babbitt
Created January 30, 2024 03:23
Show Gist options
  • Save babbitt/b1c7fb77bd625b676f140deba30b5632 to your computer and use it in GitHub Desktop.
Save babbitt/b1c7fb77bd625b676f140deba30b5632 to your computer and use it in GitHub Desktop.
Add a DNS server as default across all networks in Fedora

I spent nearly an hour looking for a guide to add a DNS server entry systemwide. The following did it in 2 lines. Hope this helps someone else

  1. Open /etc/systemd/resolved.conf
  2. Under the [Resolve] section add the following:
[Resolve]

DNS={YOUR DNS SERVER ADDRESS}
FallbackDNS={FALLBACK DNS SERVER}
FallbackDNS={Add as many of these as you wish}
  1. Run sudo systemctl restart systemd-resolved & sudo systemctl restart NetworkManager

Profit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment