Change DNS on Fedora

This has been tested as working on Fedora 32.

First add the below to the [main] section in /etc/NetworkManager/NetworkManager.conf

dns=none

This stops Network Manager from overriding /etc/resolv.conf.

You can then edit /etc/resolv.conf and add a line for your DNS server, as below.

# Use Pi-hole for DNS:
10.0.0.3

You can then check it works by issuing a dig <address>.com and you’ll see the active DNS server in the SERVER section.

; <<>> DiG 9.11.22-RedHat-9.11.22-1.fc32 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7708
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             2       IN      A       0.0.0.0

;; Query time: 21 msec
;; SERVER: 10.0.0.3#53(10.0.0.3)
;; WHEN: Mon Aug 31 21:42:12 BST 2020
;; MSG SIZE  rcvd: 44

You may need to also run the below.

sudo systemctl restart NetworkManager

About

I'm a technology professional who's been passionate about computers since my Grandad introduced me to an Intel 386 back in the 90s when I was a kid. Those moments inspired a passion within for technology, and I've been playing around with anything with a circuit board ever since. Whenever I have a moment you can probably find me working on something computer-related, and this is where I like to write about those moments.