These two config files work together to integrate Control-D for public DNS queries and dnsmasq for intranet ones (including those assigned by DHCP).
When these chages are made, the ctrld
daemon is 'in front' and receives all queries
first on listener.0, irrespective of origin. Listener.0 then diverts any that are
for *.local or my intranet to the dnsmasq instance, which has been moved to port
531, to avoid conflicts. If dnsmasq
doesn't resolve the request itself internally
(i.e. dhcp allocations, /etc/hosts
, static dhcp-host configs, etc.), it 'forwards'
it back to ctrld
on port 532, where listener.1 sends it upstream unconditionally
(i.e. listener.1 has no rules to redirect intranet requests to dnsmasq, like there
are for listener.0)
Note that you should have a working dnsmasq
configuration first, then the snippet
below should be added to it, then comment out the existing 'server =
' configuration
lines. Only then will ctrld
start successfully (because dnsmasq
would be camped on
port 53 already).