Discussion:
dhclient.conf - using both prepend and append on domain-name-servers ignores prepend line?
(too old to reply)
Hyun Hwang
2018-11-20 15:29:13 UTC
Permalink
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
Loading...