You are not logged in.

#1 2015-02-17 19:49:41

skyer
Member
Registered: 2012-06-25
Posts: 56

resolvconf keeps changing /etc/resolv.conf

Hi,
I'm using dhcpcd service unit with systemd. My /etc/dhcpcd.conf contains this line:

static domain_name_servers=8.8.4.4 8.8.8.8

But /etc/resolv.conf gets rewritten to name servers supplied by my ISP (I guess). They work but I want to use the ones I specified.

The rewritten version contains "# Generated by resolvconf" which I know is a software designed to control /etc/resolv.conf in systems with varying requirements for DNS servers - but I have no idea how to configure it.


--- additional information

[root@pc skyer]# ls /etc/resolv.conf -la
-rw-r--r-- 1 root root 76 Feb 17 12:57 /etc/resolv.conf
[root@pc skyer]# killall dhcpcd
[root@pc skyer]# dhcpcd
dhcpcd[6717]: version 6.6.7 starting
dhcpcd[6717]: DUID 00:01:00:01:1a:44:3b:c0:78:45:c4:c9:40:9e
dhcpcd[6717]: enp2s0: IAID 7e:f7:c4:d8
dhcpcd[6717]: enp2s0: rebinding lease of 192.168.1.11
dhcpcd[6717]: enp2s0: changing route to 192.168.1.0/24
dhcpcd[6717]: enp2s0: changing default route via 192.168.1.1
dhcpcd[6717]: forked to background, child pid 6729
[root@pc skyer]# cat /etc/resolv.conf 
# Generated by resolvconf
nameserver 213.46.172.37
nameserver 213.46.172.36

Thanks for any help..

Offline

#2 2015-02-17 20:15:05

nullified
Member
From: Massachusetts, USA
Registered: 2013-12-09
Posts: 468

Re: resolvconf keeps changing /etc/resolv.conf

Have you tried the directions in the wiki?


"We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves." - Ada Lovelace

Offline

#3 2015-02-20 19:58:07

skyer
Member
Registered: 2012-06-25
Posts: 56

Re: resolvconf keeps changing /etc/resolv.conf

I've seen those, but I'd like to figure out what exactly causes the rewrites, not just a way to avoid them.
1) dhcpcd shouldn't need to have nook resolv.conf option since it's exactly dhcpcd deamon I have configured to set static DNS servers
2) resolvconf -u generates the wrong file. But what makes it run in the first place?
3) chattr +i /etc/resolv.conf is an obvious hack, but like I said, I'd like to find the reason.

Thanks

Offline

#4 2015-02-20 20:15:46

mkoskar
Member
Registered: 2014-07-16
Posts: 64
Website

Re: resolvconf keeps changing /etc/resolv.conf

Have you read manual of openresolv? Most notably resolvconf.conf(5)?
Have a look at /etc/resolvconf.conf, it's pretty straighforward how to configure it with fixed list of nameservers.

Offline

#5 2015-02-21 15:20:38

skyer
Member
Registered: 2012-06-25
Posts: 56

Re: resolvconf keeps changing /etc/resolv.conf

You were right, configuring resolvconf.conf with parameters name_servers, name_server_blacklist works for me.

However, I am curious, what service calls it? I have no idea at which point it gets introduced into the system.

Offline

#6 2015-02-21 19:02:18

mkoskar
Member
Registered: 2014-07-16
Posts: 64
Website

Re: resolvconf keeps changing /etc/resolv.conf

skyer wrote:

You were right, configuring resolvconf.conf with parameters name_servers, name_server_blacklist works for me.

However, I am curious, what service calls it? I have no idea at which point it gets introduced into the system.

Well, e.g. dhcpcd calls in /usr/lib/dhcpcd/dhcpcd-hooks/20-resolv.conf.
Excerpt from it reads:

# Generate /etc/resolv.conf
# Support resolvconf(8) if available
# We can merge other dhcpcd resolv.conf files into one like resolvconf,
# but resolvconf is preferred as other applications like VPN clients
# can readily hook into it.
# Also, resolvconf can configure local nameservers such as bind
# or dnsmasq. This is important as the libc resolver isn't that powerful.

EDIT: It's worth to mention "openresolv" (which provides resolvconf) is not dhcpcd requirement, e.g., in my system it's pulled in as dependency of netctl.

Last edited by mkoskar (2015-02-21 19:06:34)

Offline

#7 2015-02-25 07:55:30

skyer
Member
Registered: 2012-06-25
Posts: 56

Re: resolvconf keeps changing /etc/resolv.conf

Aha, that resolves it!

Thanks everybody for help.

Offline

Board footer

Powered by FluxBB