I want to change my DNS nameserver to GoogleDNS on fedora 25. I edited /etc/resolv.conf from

search fritz.box



But if I reconnect to router, the file will revert back to my router's DNS nameserver. I followed this https://developers.google.com/speed/public-dns/docs/using this link's tutorial for debian part. But it isn't working.

Can I change nameserver to google's DNS permanently?

P.S: I do not have access to the router.

3 Answers 3


The issue is you are getting the DNS server from the router and overriding what you set. To fix this, you must edit /etc/dhclient.conf.

Add this line to make sure that it does not override the default DNS servers:

supersede domain-name-servers,;

Alternatively, you can instruct the DHCP client to not request a DNS server address.

More information can be found with the man dhclient.conf command.


Below Solution Worked in my box (Fedora release 25)


Added below entries to above file at the bottom.


And restarted network (service network restart) to ensure that the entries are not modified in /et/resolv.conf


I solved this by going to network manager and editing my connection in IPv4 tab, sliding automatic to manual for DNS and then setting server address to the one I need. (GNOME) Or I could edit resolve.conf and then change its attribute with option i, like `chattr +i resolv.conf . Therefore stopping DHCP from editing it again. I observed that in xfce4​ - network manager we have to change the DHCP in IPv4 to automatic address but manual DNS in options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.