You are not logged in.

#1 2009-07-03 20:42:26

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

dhcpcd ignores "domain_name_servers" option? [SOLVED]

I've tried setting up two arch systems to use openntpd (instead of the local dns). One is an i686, the other one an x86_64. On both systems, removing the "domain_name_servers" option makes dhcpcd still write a nameserver line in the resolv.conf...

I wanted to hear if other people experience this problem as well, or if I've overlooked some obvious configuration error (it wouldn't be the first one wink ), since I've not seen anyone else report this problem.

In the 32bit one (which has been running for a year or so), I used to use the "-C" solution, but when I first experienced this problem on the new system, I wanted to make sure the problem wasn't 64bit related.

I have also tried commenting out the specific "option" line (with domain_name, domain_search, host_name), but it still writes to resolv.conf... tongue

this is my resolv.conf.head:

nameserver 208.67.222.222
nameserver 208.67.220.220

this is my dhcpcd.conf:

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Inform the DHCP server of our hostname for DDNS.
hostname

# A list of options to request from the DHCP server.
option domain_name, domain_search, host_name
# Most distributions have NTP support.
option ntp_servers

# Behave nicely on networks and respect their MTU.
# However, a lot of buggy DHCP servers set invalid MTUs so this is not
# enabled by default.
#option interface_mtu

# A ServerID is required by RFC2131.
# Some broken DHCP servers do not send one and dhcpcd can work without it.
# Some broken DHCP servers NAK incorrectly and do not include a ServerID either so
# the default is to require a ServerID.
require dhcp_server_identifier

# 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

and this is the resulting resolv.conf:

nameserver 208.67.222.222
nameserver 208.67.220.220
domain .
nameserver 192.168.1.1
# /etc/resolv.conf.tail can replace this line

You might wonder why I didn't just use the "-C" argument on the 64bit system? The answer is that that doesn't prevent dhcpcd from writing to the resolv.conf either(!), instead it generates the following (and yes, /etc/resolv.conf.head does exist):

# Generated by dhcpcd
# /etc/resolv.conf.head can replace this line
# /etc/resolv.conf.tail can replace this line

(note that this only happens on the 64bit system, it works the way it should on the 32bit)

I would appreciate any answer, even from people that doesn't experience this problem (as it would pinpoint the problem to my side).

Last edited by 1311219 (2009-07-04 12:58:25)

Offline

#2 2009-07-04 00:39:12

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: dhcpcd ignores "domain_name_servers" option? [SOLVED]

1311219 wrote:

I've tried setting up two arch systems to use openntpd (instead of the local dns). One is an i686, the other one an x86_64. On both systems, removing the "domain_name_servers" option makes dhcpcd still write a nameserver line in the resolv.conf

Well, you are no longer requesting the option, but the DHCP server gave it to you anyway.
To reject options gratuitously given, use the nooption directive as documented in the dhcpcd man page.

noption domain_name_servers

dhcpcd-5.0.6 will document the option in the dhcpcd.conf man page also wink

Offline

#3 2009-07-04 12:08:31

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: dhcpcd ignores "domain_name_servers" option? [SOLVED]

Absolutely excellent, thanks a lot! smile

I just commented out the "option" line, and added a "nooption" for "domain_name_servers" and "domain_name".

This should really be added to the wiki...

Last edited by 1311219 (2009-07-04 12:08:43)

Offline

#4 2009-07-04 12:48:46

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: dhcpcd ignores "domain_name_servers" option? [SOLVED]

If you wanted to skip all DNS related options, you could always add

nohook resolv.conf

To stop dhcpcd from ever touching resolv.conf on your machine

Offline

#5 2009-07-04 13:06:00

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: dhcpcd ignores "domain_name_servers" option? [SOLVED]

(Just tested on the 64bit system for now)
It still seems to touch the resolv.conf... yikes
But it does include the resolv.conf.head file, which the "-C resolv.conf" argument didn't (even weirder), and it seems like a cleaner solution, so I think I'll go with the nohook method. Thanks again! smile

Offline

#6 2009-07-04 13:20:52

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: dhcpcd ignores "domain_name_servers" option? [SOLVED]

You could always look into a resolvconf package as well, as that is even cleaner still as dhcpcd supports it out of the box.
I made openresolv, a better resolvconf - http://roy.marples.name/projects/openresolv/wiki

I don't know if that's available in Arch or not .....

Offline

#7 2009-07-05 12:04:21

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: dhcpcd ignores "domain_name_servers" option? [SOLVED]

Interesting. But I think I'll just stick with the current "nohook" method for now, thanks for all the help! smile

Offline

Board footer

Powered by FluxBB