Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Nov 2018 10:29:13 -0500
From:      Hyun Hwang <hyun@caffeinated.codes>
To:        freebsd-net@freebsd.org
Subject:   dhclient.conf - using both prepend and append on domain-name-servers ignores prepend line?
Message-ID:  <1542727753.2153805.1583287672.158E5AFF@webmail.messagingengine.com>

next in thread | raw e-mail | index | archive | help
Hi,

I'm poking around dhclient.conf to see if I can get dnscrypt-proxy to co-exist with captive portals. I've set an alias of 127.0.0.2 to interface lo0 then set dnscrypt-proxy to run on the address. Then I've added the following lines to dhclient.conf:

```
# /etc/dhclient.conf

# dnscrypt-proxy2
prepend domain-name-servers 127.0.0.2;
# Backups
append  domain-name-servers 1.1.1.1, 1.0.0.1;
```

I expected the above addition yield the following in resolv.conf:

```
search some-search-domain.com
nameserver 127.0.0.2
nameserver [SOME_DHCP_SERVER_SET_DNS_IP1_HERE]
nameserver [SOME_DHCP_SERVER_SET_DNS_IP2_HERE]
nameserver 1.1.1.1
nameserver 1.0.0.1
```

However, the actual result is that the dhclient completely ignored the prepend option:

```
search some-search-domain.com
nameserver [SOME_DHCP_SERVER_SET_DNS_IP1_HERE]
nameserver [SOME_DHCP_SERVER_SET_DNS_IP2_HERE]
nameserver 1.1.1.1
nameserver 1.0.0.1
```

Are the prepend and append options mutually exclusive or are they working in a last-to-appear-wins manner? I couldn't find this behavior being mentioned in any of the man pages.

Any lead would be appreciated.
Thanks,
-- 
Hyun Hwang



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1542727753.2153805.1583287672.158E5AFF>