[SOLVED] 16.7.10: DNS Forwarder host overrides have stopped working

Started by danuary, December 05, 2016, 03:26:27 PM

Previous topic - Next topic
Quote from: franco on December 08, 2016, 08:15:01 AM
Not my most favourite solution, but more reports came up. Run this from the console and restart/reboot:

# opnsense-patch cd6cdba1b

https://github.com/opnsense/core/commit/cd6cdba1b


Cheers,
Franco
Got hit by this now. Upgraded and none of the dns overrides work.

dnsmasq-hosts is readable:
-rw-r--r--  1 root  wheel  475 Dec  8 17:41 /var/etc/dnsmasq-hosts

Tried the patch above, but still nothing.

Its as if dnsmasq does not load /var/etc/dnsmasq-hosts at all. At the same time it DOES read /etc/hosts (and logs this):
Dec  8 17:41:35 mono dnsmasq[89726]: read /etc/hosts - 2 addresses

So as a workaround i just appended the contents of /var/etc/dnsmasq-hosts to /etc/hosts and restarted dnsmasq so my users will not kill me in the morning...

"Glad" to see that I'm not alone...

Another GUI solution that works for me, switch between DNS Forwarder to DNS Resolver which also allows host & domain overrides.

xofer : you just copy /var/etc/dnsmasq-hosts to /etc/hosts ? do you have an example of /var/etc/dnsmasq-hosts ?

Thanks for your help


Ok, so it seems people don't use "regdhcp" and thus don't have overrides or static leases. I've changed a piece of code now that wasn't changed before, but seemed to rely on a hardcoded /etc/hosts usage, meaning the actual include statement was defunct all along. Let's try this patch...

https://github.com/opnsense/core/commit/f31e5560

# opnsense-patch f31e5560


Cheers,
Franco


Quote from: sidney_v on December 08, 2016, 07:16:23 PM
xofer : you just copy /var/etc/dnsmasq-hosts to /etc/hosts ? do you have an example of /var/etc/dnsmasq-hosts ?
No, i appended it.
Basically what i did:
cat /var/etc/dnsmasq-hosts >> /etc/hosts
and then restarted dnsmasq

They are the same format so it worked. Be aware that it is strictly a workaround, not a solution! Web configurator still writes things to /var/etc/dnsmasq-hosts and these changes will not reach /etc/hosts and also /etc/hosts might be overwritten at some other point (I don't really know when this is created - mayb on boot, maybe if you change your nameserver or host name).

Haven't had a chance to test patch f31e5560 - and cannot test at the moment (70 people using the router right now...). But if it solves the problem of dnsmasq loading the correct file this is by far better than mucking about with the files. I just did a quick hack to not get phonecalls in the morning.

Noticed, I won't use it because last patch works.
Thank you xofer ;)

Thanks for confirming. Both patches will be included in 16.7.11. :)