I have a secondary router running OpenWrt, configured as a "dumb AP"; it must not act as a DHCP or DNS server for the "main" network, as those services are already being provided by the main router. If I disable the DNSMASQ service completely, everything works as expected. So far, so good.
This device has also an "AUX" network (not connected to the main router at all) on one of the ethernet ports, where it must act as a DHCP server; so I must use DNSMASQ on this secondary router, but just for this specific "AUX" network. Still good enough.
If I enable the DNS service on DNSMASQ, it tries to be smart about local names, and wrecks all the configuration; I could not configure it as a "dumb forwarder" and send all request (bogus or not) directly to the main router. If I disable the DNS service ("option port 0"), then the start script ("/etc/init.d/dnsmasq") will put "127.0.0.1" at "/etc/resolv.conf" and break everything.
Can I configure DNSMASQ to act exclusively as a DHCP server and not configure itself as the local resolver?
... or ...
Can I configure DNSMASQ to just forward absolutely all DNS requests to the upstream server?
... or ...
Does anybody know of a better solution?
Yes, thanks for the idea; I think that would fix the issue, and I could probably write a script to do that each time DNSMASQ reboots. But I would rather find a more stable solution, or is that the only viable option?
Dnsmasq doesn't mess with the resolv in /etc, only with the resolves in /tmp.
As long as you delete the symlink and recreate the file, it will be fine until you flash the router.
Or don't use a resolve file at all and instead use list server <main router dns server ip> in dnsmasq config section.
//edit
Hmm...
Actually, dhcp relay can be used here.
But I have no clue how to configure multiple dhcp scopes on a single interface through uci.
Is it even possible?
Something like:
dump ap:
disable resolve file in dnsmasq config (option noresolve)
configure dnsmasq to use the main routers dns server (list server)
configure/disable all other options mentioned in my previous post. (maybe still use domain option)
But I need the DNS on the secondary router to serve names that are only known to the DNS on the main router.
domainneeded, boguspriv, localise_queries, and expandhosts ensure requests for local host names are not forwarded to upstream DNS servers.
Did you try to modify those setitngs?
[/quote]
Yes, I tried... this is probably the "dumb forwarder" path, but I did not manage to find a combination of values for those options that did not block some or all local queries; I should probably give it a second try.
Thanks, but I do not need to use a specific resolvfile as an input for DNSMASQ: the DHCP on the main router already triggers a suitable configuration to the secondary router. What I need is for the DNSMASQ init script to stop touching that resolvfile.
The hostnames of the clients in the subnet of the main router?
You can use
list server '/intranet/<ip of main router>'
list server '<ip of other dns server>'
All requests for the intranet domain will be forwarded to your main routers dns server.
All other requests will be forwarded to other servers.
But I'm not sure if requests for the dhcp hostnames in the dump ap subnet then also get forwarded to the main routers dns server or if they have precedence,
Would be better to have dhcp managed also on the main router and use a relay.
So the local hostnames can be resolved on all networks.
With the above approach the clients in the main routers subnet can't resolve hostnames from the dump ap subnet.
But because you configured the dump ap dns server as dump forwarder it will make no difference.