Report this

What is the reason for this report?

Fedora 33 -- how to persist DNS settings via /etc/resolv.conf?

Posted on January 6, 2021

I’m having issues with DNS on my Droplet. It cannot connect to outside servers, even ping doesn’t work. Not even dnf update.

So I followed an earlier suggestion found in this forum to persist the resolv.conf file.

  1. I changed the /etc/resolv.conf to use Google’s servers.
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4

  1. Then to make it persistent, I added “dns=none” in the [main] section of /etc/NetworkManager/NetworkManager.conf
[main]
plugins = ifcfg-rh,
dns=none

  1. Then I restarted NetworkManager:
sudo systemctl restart NetworkManager.service

I tried ping after this. No go. Still not working.

So I rebooted this droplet.

Still the same, ping not working. AND the /etc/resolv.conf file got changed to the default again:

nameserver 127.0.0.53
options edns0 trust-ad

What can I do? Is this related to cloud.init? Something unique in Fedora? Never happened to me in CentOS. RedHat suggests to make resolv.conf a symlink instead, is that something we need to do in Fedora??

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.