You are not logged in.

#1 2014-07-16 16:33:49

jenia
Member
Registered: 2014-07-12
Posts: 43

dhcpcd overriding /etc/resolv.conf, 'nohook resolv.conf' [solved]

hello.

I set dhcpcd not to override the /etc/resolv.conf file:

[root@ jenia]# cat /etc/dhcpcd.conf 
...
    # A hook script is provided to lookup the hostname if not set by the DHCP
    # server, but it should not be run by default.
    nohook lookup-hostname
    noipv4ll
    nohook resolv.conf <----------------------------------------------------------------------------

However, this has no effect:

[root@ jenia]# cat /etc/resolv.conf              
    domain members.linode.com
    nameserver 72.14.179.5
    nameserver 72.14.188.5
    nameserver 2600:3c00::2
    nameserver 2600:3c00::3
    options rotate

[root@ jenia]# systemctl start dhcpcd@eth0.service 

[root@ jenia]# cat /etc/resolv.conf               
    # This file is managed by systemd-resolved(8). Do not edit.
    #
    # Third party programs must not access this file directly, but
    # only through the symlink at /etc/resolv.conf. To manage
    # resolv.conf(5) in a different way, replace the symlink by a
    # static file or a different symlink.

    nameserver 8.8.8.8
    nameserver 8.8.4.4
    nameserver 2001:4860:4860::8888
    # Too many DNS servers configured, the following entries may be ignored
    nameserver 2001:4860:4860::8844

As you can see dhcpcd ovveride the /etc/resolv.conf file.
How can I avoid this? How can I change the file and make the changes permanent.

Thanks in advance.

Last edited by jenia (2014-07-16 17:20:02)

Offline

#2 2014-07-16 16:39:27

jenia
Member
Registered: 2014-07-12
Posts: 43

Re: dhcpcd overriding /etc/resolv.conf, 'nohook resolv.conf' [solved]

Actually, i noticed that its systemd-networkd.service that overrides that file. Does anyone know how to stop it from doing so?

Offline

#3 2014-07-16 16:53:40

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: dhcpcd overriding /etc/resolv.conf, 'nohook resolv.conf' [solved]

is /etc/resolv.conf a symlink?

Offline

#4 2014-07-16 17:19:08

jenia
Member
Registered: 2014-07-12
Posts: 43

Re: dhcpcd overriding /etc/resolv.conf, 'nohook resolv.conf' [solved]

yes. exactly. i removed and used a text editor to make the necessary changes to a file of the same name (/etc/resolv.conf).
now the changes remained.
thanks.

Offline

Board footer

Powered by FluxBB