Report this

What is the reason for this report?

DNS and cloud init; where is the proper location to set the resolver

Posted on February 15, 2020

I’m running Centos 7. All the usual places to change the DNS resolver have a warning message that this file is created by cloudinit. So where do I actually set the resolver address? That is I need a file not created by cloudinit or any other automatic process.

The only reason I ask is in the last few days my reverse DNS check in Postfix has failed on some IP addresses that are fine, i.e. do have a reverse pointer. For example google gmail servers and comcast.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @gc948486cbc56b8,

If you wish to change your Resolv.conf you’ll need to edit your /etc/NetworkManager/NetworkManager.conf file. Open the file and search for the [main] section in this file. As soon as you find it, Add dns=none just after the [main] tag:

[main]
dns=none

Now that you are done with that part, update your /etc/resolv.conf to whatever you like and restart your NetworkManager.

sudo systemctl restart NetworkManager.service

And that’s it, your resolv.conf should now be safe.

Regards, KDSys

My DO server Ubuntu 20 droplet install did not have resolvconf installed by default. So …

This link has a straight, DO specific answer, and it solved the same issue for me:

https://www.digitalocean.com/community/questions/how-to-permanently-change-dns-nameservers-in-ubuntu-18-04-3-wiki-article-is-not-working

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.