Bug 248715

Summary: dhclient: prepend domain-name-servers in dhclient.conf 'replaces' dhcpd provided value
Product: Base System Reporter: Dmitry Afanasiev <KOT>
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Not A Bug    
Severity: Affects Some People CC: roy
Priority: --- Keywords: needs-patch, needs-qa
Version: 12.1-STABLEFlags: koobs: mfc-stable12?
koobs: mfc-stable11?
Hardware: Any   
OS: Any   

Description Dmitry Afanasiev 2020-08-18 06:38:14 UTC
I'm want to use local dnsmasq. I added this line to dhclient.conf:
prepend domain-name-servers 127.0.0.1;

But got in resolv.conf *ONLY* "127.0.0.1", and no NS from dhclient.

This problem exists starting from FreeBSD-10, on some older release this options was worked properly.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-08-18 11:27:22 UTC
I was meant to report this a short while ago on CURRENT:

https://twitter.com/koobs/status/1284414758301470720

I think the append/prepend issue affects more than just 'domain-name-server' as well.
Comment 2 Dmitry Afanasiev 2020-08-24 12:58:07 UTC
I'm not checked all prepend options, but option "prepend domain-name" works propely.
Comment 3 roy 2021-02-01 23:57:06 UTC
FreeBSD uses openresolv.
If openresolv sees 127.0.0.1 then it assumes that the local resolver is configured correctly.

You should see your DHCP provided nameservers still with
`resolvconf -l`

You can change the default by adding this to /etc/resovlconf.conf
resolv_conf_local_only=NO
Comment 4 Dmitry Afanasiev 2021-12-19 15:42:19 UTC
Okey, use resolvconf.conf to prepend nameservers + resolv_conf_local_only="NO" is a good solution.
Thanks You!