Ask the Community
Groups
Unitrends Appliance DNS Servers change after a reboot/network restart. - Connect IT Community | Kaseya
<main> <article class="userContent"> <h2 data-id="issue"><strong>ISSUE</strong></h2> <p></p> <h1 data-id="dns-servers-in-etc-resolv-conf-change-after-a-reboot-network-service-restart">DNS servers in /etc/resolv.conf change after a reboot/network service restart.</h1> <p>You would also see messages shown below in the <strong>/var/log/messages</strong> file:</p> <pre class="code codeBlock" spellcheck="false" tabindex="0"> Oct 10 12:40:52 hostname NET[22961]: /etc/sysconfig/network-scripts/ifdown-post : updated /etc/resolv.conf Oct 10 12:40:57 hostname NET[23256]: /etc/sysconfig/network-scripts/ifup-post : updated /etc/resolv.conf</pre> <h2 data-id="resolution"><strong>RESOLUTION</strong></h2> <p></p> <h2 data-id="how-to-make-entries-in-etc-resolv-conf-permanent">How to make entries in /etc/resolv.conf permanent</h2> <p>1. The /etc/resolv.conf file will be overwritten if any network interfaces use DHCP for activation. To prevent this, ensure such interfaces have PEERDNS=no set in their ifcfg file, for example:</p> <p> </p> <pre class="code codeBlock" spellcheck="false" tabindex="0"> # cat /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE=Ethernet DEVICE=eth0 BOOTPROTO=dhcp <strong>PEERDNS=no</strong></pre> <p>2. The ifcfg-file directives DNS1 and DNS2 can also lead to modification of resolv.conf. To prevent this, either remove said directives or use chattr(1) to make resolv.conf immutable to changes, i.e.:</p> <pre class="code codeBlock" spellcheck="false" tabindex="0"> # chattr +i /etc/resolv.conf</pre> </article> </main>