I want to use Unbound as recursive DNS resolver, and dnsmasq just for DHCP and for generating DNS entries for hostnames.
I’m following this section of the Unbound docs https://github.com/openwrt/packages/blob/master/net/unbound/files/README.md#parallel-dnsmasq and everything seems to be working, but I’m having some trouble understanding what some of the options I’m setting mean and how the setup actually works.
I understand that Unbound is exposed on port 53, and dnsmasq is on port 1053 and will only handle LAN domains:
> , dig @10.17.0.1 -p 53 +short fast.com
184.25.66.202
> , dig @10.17.0.1 -p 53 +short hostname.home.arpa
10.17.0.152
> , dig @10.17.0.1 -p 1053 +short hostname.home.arpa
10.17.0.152
> , dig @10.17.0.1 -p 1053 +short fast.com
but how does Unbound know to forward my local DNS names to dnsmasq? Where is that configured?
Secondly, what does the following do?
option noresolv '1'
option resolvfile '/tmp/resolv.conf.auto'
I understand I want noresolv so it doesn’t configure any upstream servers (/etc/resolv.conf is linked to linked to resolvfile and contains localhost which would be Unbound, so that’s fine), but then why do we set resolvfile? And do I need to have localuse=1 set? I seem to be able to ping local domains on the router with that set to 0 or 1.
Finally, why do we specify address as 0.0.0.0 here?
`config dhcp 'lan'
dnsmasq may not issue DNS option if not std. configuration
list dhcp_option 'option:dns-server,0.0.0.0'`
Is this the same as setting it to my LAN IP? Clients do get my router LAN IP as a DNS server via DHCP. Thanks