Hey guys, I have problem in my server dns in resolve.conf keep reseting after upgrade or reboot
what should I do to stop this ?

Dani AI

Generated

A short, practical summary that builds on the existing replies

This behavior is normal: /etc/resolv.conf is usually generated at boot or when an interface comes up by whatever DNS manager your distribution is using (DHCP client + resolvconf, NetworkManager, systemd-resolved, or netplan/renderer). was correct that changes made directly to /etc/resolv.conf are temporary; ’s question about resolvconf and ’s note about putting DNS in the interface configuration are both on the right track — the correct fix is to update the component that actually manages resolv.conf. (manpages.debian.org)

Quick diagnosis (do this first)

ls -l /etc/resolv.conf
cat /etc/resolv.conf
resolvectl status    # or `systemd-resolve --status` on older systems

If the file is a symlink to a resolvconf path, use resolvconf to make persistent changes; if it points to systemd-resolve stub files (127.0.0.53), systemd-resolved is in charge; if it comes from /run/NetworkManager, NetworkManager is the manager. These clues tell which config to change. (manpages.debian.org)

How to make DNS changes persist (high‑level options)

  • resolvconf systems: place static lines in the resolvconf drop‑ins (head/base/tail) so resolvconf generates them on updates, then refresh the resolver. This is the supported method for distributions using resolvconf. (manpages.debian.org)

  • systemd-resolved systems: either configure DNS in /etc/systemd/resolved.conf or switch the /etc/resolv.conf symlink to the “real” resolved output (instead of the local stub) so the upstream servers are visible to traditional tools; use resolvectl/systemd-resolve to inspect and apply changes. (manpages.ubuntu.com)

  • NetworkManager / Netplan systems: set the per-connection DNS (via nmcli, the GUI, or the Netplan YAML nameservers block) or adjust NetworkManager’s rc-manager/dns mode if you want it to stop rewriting resolv.conf. On older Ubuntu/ifupdown setups the /etc/network/interfaces dns entries work, which matches ’s successful fix; on newer releases Netplan/NetworkManager/systemd-resolved are more likely to be involved. (networkmanager.dev)

Caution: don’t edit /etc/resolv.conf by hand unless you intend to replace the symlink with a static file — that only hides the real problem and will be reverted next time the managing service runs.

Recommended Answers

All 10 Replies

Do you directly edit the file or you use resolvconf command?

The file /etc/resolv.conf (no trailing 'e') is controlled by your network dns settings. If you change it manually, the changes will only be in effect until the next update or reboot, unless you change your network settings to block that. Sorry, but I don't remember right now what settings need to be changed, but I know I have done that some time in the deep, dark past.... :-) Remember, Google is your friend!

Also, if you are using ubuntu 12 or better, dns entries are made in \etc\network\interfaces now.
i.e.
'dns-nameservers 4.2.2.1 4.2.2.2'

How can I activate my bluetooth?

Makhetha, please don't hijack another's thread. Please start your own and we will attempt to answer your question. That said, please provide more information, such as system to connect with, the device you are trying to connect, the operating system you are using, etc.

comment nm_controlled in network interface file and also add DNS enrt in network interface file

vi /etc/sysconfig/networking-script/ifcfg-eth?
DNS1= add IP
DNS2= add IP

NM_CONTROLLED=yes

Add this to all interface so while rebooting DNS IP will up
i think might be there is bug in redhat6

NM_CONTROLLED=yes

comment NM_CONTROLLED=yes


you were right :D
thanks

Sweet !!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.