It’s also turned on in /etc/config/kresd if dynamic domains is turned on. It’s not turned on for me, but it’s already been set permanently on in resolver
if [ "$DYNAMIC_DOMAINS" = "1" ]; then
echo "Enable dhcp script"
config_foreach set_dnsmasq_dhcp_script dnsmasq "$DHCP_SCRIPT"
#reload dhcp config with script param
/etc/init.d/dnsmasq reload
fi
I don’t have the patience to figure out what it’s supposed to do exactly, but I am guessing it’s supposed to do for kresd/unbound what dnsmasq does automatically.
So, it would really be best if, instead of automatically enabling it every time without choice, there was some way to turn it off.
[EDIT]
If I comment out
DHCP_SCRIPT=/etc/resolver/dhcp_host_domain_ng.py
in /etc/init.d/resolver makes the entry in /etc/config/dhcp go away after I restart resolver (/etc/init.d/resolver restart). I then had to restart dnsmasq (/etc/init.d/dnsmasq restart).
Anyway, I really dont want to have log spammed with those “debug” messages. I dont have DNS for local hostnames enabled in Foris, I just use static IPs for .lan devices, and hostname resolving works as it should (quite a long time, didnt remember version of turris, but it works without dnsmasq/kresd port fiddling) without this annoying python(!) script… Both for obyvak.lan and obyvak, for example.
btw, I see that watchdog restarts resolver each 10 min? Dont know when this starts, but I am sure that resolver is OK and doesnt need to restart all the time…
I thing watchdog has a serious bug, because detection resolver on default Omnia configuration is broken.
/etc/init.d/resolver generates wrong resolver.pid file. Mine always contains more numbers, because running process:
The situation is the same as before. On each reboot dnsmasq does not start because of “option dhcpscript ‘/etc/resolver/dhcp_host_domain_ng.py’” in /etc/config/dhcp. And so long dnsmasq is not running, no ipv4 adresses are distributed to any device (lan and wlan). Very annoying!
I don’t want to fiddle in init.d files to fix this.
So am I right, that dnsmasq is the preferred service to distribute ipv4 adresses? If yes, why it does not start?
Formerly I did this adaption to my router, so that dnsmasq resolves local host names (Dnsmasq .lan domain while still using knot resolver). But as I understand all my adaptions should be overwritten by new opkg versions of knot-resolver.
So how can I get back to TO which can (automatically) be rebooted and ALL devices are getting network connections?
I’m not sure. I did those changes too, but I’ve not had any issues with dnsmasq running. Perhaps there is a different issue with dnsmasq.
I realized I didn’t do my edits after the last update and the DHCP script was uncommented. As a result, I found that there are two running copies of dnsmasq:
3286 nobody 1312 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k -x /var/run/dnsmasq/dnsmasq.pid
3291 root 1304 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k -x /var/run/dnsmasq/dnsmasq.pid
It appears that /etc/resolver/dhcp_host_domain_ng.py starts dnsmasq as user root, where the regular dnsmasq startup script uses nobody, which is more secure.
Do you save your logs anywhere? That might give you an indication what’s going on. Perhaps the dnsmasq init script, since it should start dnsmasq as nobody, is having trouble reading one of the config files.
For better or worse, due to all the customizations I’ve made, I now have about 10-15 items I check every time there’s an update. I just added the commenting out the DHCP_SCRIPT to the list.
After deleting “option dhcpscript ‘/etc/resolver/dhcp_host_domain_ng.py’” and manually starting dnsmasq as root I have also two dnsmasq processes:
3225 nobody 920 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k -x /var/run/dnsmasq/dnsmasq.pid
3227 root 912 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k -x /var/run/dnsmasq/dnsmasq.pid
I found in /var/log/messages following error:
2017-11-24T17:04:59+01:00 crit dnsmasq[3078]: illegal repeated keyword at line 11 of /var/etc/dnsmasq.conf
2017-11-24T17:04:59+01:00 crit dnsmasq[3078]: FAILED to start up
2017-11-24T17:04:59+01:00 info procd: Instance dnsmasq::instance1 s in a crash loop 6 crashes, 0 seconds since last crash
So here is the content of this file, numbered the lines: