resolv.conf keeps changing by itself

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
jaapaikema
Posts: 29
Joined: Fri Sep 12, 2014 11:16 pm
Location: NL
ZCS/ZD Version: Release 8.8.15_GA_3869.RHEL7_64_201
Contact:

resolv.conf keeps changing by itself

Post by jaapaikema »

I installed Zimbra on a new VM but after a restart of zimbra my /etc/resolv.conf gets changed.
When I restart zimbra (zmcontrol restart as zimbra user) at the top of /etc/resolv.conf appears a line "nameserver 127.0.0.1"
Anyone have a sollution for this problem?
At first I thought I did something wrong, but now it is happening on a second server also.

The technical details:

VM1: CentOS 7 - Firewall and PowerDNS (192.168.52.201 - firewall.mydomain.home)
VM2: CentOS 7 - Zimbra Release 8.6.0_GA_1153.RHEL7_64_20141215151110 RHEL7_64 FOSS edition, Patch 8.6.0_P4 (192.168.52.203 - zimbra.mydomain.home)

#cat /etc/resolv.conf:
domain mydomain.home
search mydomain.home
nameserver 192.168.52.201
nameserver 8.8.8.8
#cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.52.202 zimbra.mydomain.home zimbra

jaapaikema
Posts: 29
Joined: Fri Sep 12, 2014 11:16 pm
Location: NL
ZCS/ZD Version: Release 8.8.15_GA_3869.RHEL7_64_201
Contact:

resolv.conf keeps changing by itself

Post by jaapaikema »

The change occurs when dnscache is started
phoenix
Ambassador
Ambassador
Posts: 27278
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

resolv.conf keeps changing by itself

Post by phoenix »

The resolv.conf gets changed because you're using DHCP to allocate an IP address, this is nothing to do with Zimbra.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
jaapaikema
Posts: 29
Joined: Fri Sep 12, 2014 11:16 pm
Location: NL
ZCS/ZD Version: Release 8.8.15_GA_3869.RHEL7_64_201
Contact:

resolv.conf keeps changing by itself

Post by jaapaikema »

@phoenix:

This is NOT a DHCP-problem, cause the VMs both use static IPs.

The changing is being done by dnscache when it is started after zmconfigd.

I verified this by monitoring the /etc/resolv.conf during a restart of zimbra
JOvalles P.
Posts: 27
Joined: Thu Jun 18, 2015 3:00 pm

resolv.conf keeps changing by itself

Post by JOvalles P. »

easy, you /etc/resolv.conf most like a:



search yourdomain.com

nameserver xx.xxx.xx.xx (ip dns)



in some cases, in the first line says: automatic update by ...... (something)



in the config of interface eth0, eth1 or something add or edit the attribute NM_CONTROLLED=no (this is the network manager)
phoenix
Ambassador
Ambassador
Posts: 27278
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

resolv.conf keeps changing by itself

Post by phoenix »

[quote user="jaapaikema"]@phoenix:
This is NOT a DHCP-problem, cause the VMs both use static IPs.
The changing is being done by dnscache when it is started after zmconfigd.
I verified this by monitoring the /etc/resolv.conf during a restart of zimbra[/quote]Well, it might help if you didn't leave out vital information from your problem description. This still isn't a Zimbra problem, it's a configuration problem as mentioned in the post above. You could always leave out dnscache, it's not obligatory and this doesn't happen on my server with the changes mentioned above. I'd suggest that in future you give a complete description of the problem and what you've done to try and debug it then you probably won't end up with half an answer. [;)]
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
jaapaikema
Posts: 29
Joined: Fri Sep 12, 2014 11:16 pm
Location: NL
ZCS/ZD Version: Release 8.8.15_GA_3869.RHEL7_64_201
Contact:

resolv.conf keeps changing by itself

Post by jaapaikema »

Removing dnscache does the trick.

Now after a "zmcontrol restart" resolv.conf is unaffected.

This is however not realy a satisfatory soluting.

The initial problem still exsists and is somehow connected to the dnscaching function.
phoenix
Ambassador
Ambassador
Posts: 27278
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

resolv.conf keeps changing by itself

Post by phoenix »

The problem isn't dnscache it's your nic configuration. As I mentioned earlier, if I have correctly configured fixed IP nics I don't see the behaviour you've described.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
jaapaikema
Posts: 29
Joined: Fri Sep 12, 2014 11:16 pm
Location: NL
ZCS/ZD Version: Release 8.8.15_GA_3869.RHEL7_64_201
Contact:

resolv.conf keeps changing by itself

Post by jaapaikema »

The NIC config:



NAME="Interface eth0"

DEVICE="eth0"

ONBOOT=yes

NM_CONTROLLED=no

IPV4_FAILURE_FATAL=no

BOOTPROTO=static

NETWORK=192.168.52.0

IPADDR=192.168.52.202

NETMASK=255.255.255.0

BROADCAST=192.168.52.255

GATEWAY=192.168.52.201

TYPE="Ethernet"

DEFROUTE=yes

PEERDNS=no

PEERROUTES=no

USERCTL=no



I don't see anything wrong with this config
BradC
Outstanding Member
Outstanding Member
Posts: 266
Joined: Tue May 03, 2016 1:39 am

Re: resolv.conf keeps changing by itself

Post by BradC »

The other thing you can do is hack around it by making it immutable.

chattr +i /etc/resolv.conf
Post Reply