Bug 217243 - dhclient doesn't consistently update /etc/resolv.conf with what is defined in /etc/dhclient.conf
Summary: dhclient doesn't consistently update /etc/resolv.conf with what is defined in...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 11.0-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-20 02:24 UTC by Josh
Modified: 2017-02-20 02:25 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh 2017-02-20 02:24:08 UTC
dhclient doesn't consistently update /etc/resolv.conf with what is defined in /etc/dhclient.conf. Sometimes changes to /etc/dhclient.conf take effect, usually they don't. I haven't been able to figure out a pattern to it.

This is on an AWS EC2 nano VM using cpercival's FreeBSD 11 AMI, running 11.0-RELEASE-p7.

If I add this line to /etc/dhclient.conf:

supersede domain-name "foo.com";

(in fact, that is all I have in that file)

*Sometimes* restarting dhclient via:

sudo service dhclient restart xn0

causes it to update /etc/resolv.conf with the search line, but usually it doesn't do anything to /etc/resolv.conf. I probably tried 25 times after various changes (trying to get it to work), touch, rm, etc., and it only updated resolv.conf twice. One time I think all I did was add a space. I tried without sudo and stop/start but neither made a difference.

Just now, after 10 failures, it changed. I added a space before the last " in my file (i.e.: "foo.com ";). A restart caused the domain to show up in resolv.conf. Removing the domain from resolv.confand restarting dhclient without any changes to dhclient.conf didn't put the domain back into resolv.conf, however. Changing dhclient.conf by removing the space and restarting dhclient DID result in the domain being put back in to resolv.conf. Another restart, no change in resolv.conf. Adding the space back worked.

I wonder if it caches something somewhere so only changes to the actual domain value (string) are causing it to regenerate resolv.conf.
Comment 1 Josh 2017-02-20 02:25:14 UTC
Maybe incorrectly, but I was expecting a restart to regenerate resolv.conf with the domain in it regardless of if the domain string value in dhclient.conf changed (if the domain wasn't already in resolv.conf).