Serving DNS for multiple routers and networks

I'm currently using the default dnsmasq on several routers at different locations. These routers are all connected via wireguard and routing works great between networks. When using IP addresses everything works great.

What I'm looking to do is use dns names instead of IP addresses for scripts, backups, etc. Using DNS forwarding in dnsmasq for each routers domain I'm able to accomplish valid lookups, which is fine if that is all I'm able to do. I also don't want to run a full fledged BIND server and have zones, etc. to manage.

Right now I'm only able to get things working if the domain is included when doing a lookup. Here is my current scenario:

  • I have two networks:
    • Subnet: 10.10.1.0/24 Domain: Blue
    • Subnet: 10.10.2.0/24 Domain: Yellow
  • Each network is served by a different OpenWRT router connected over the internet via wireguard. All routing works great, so the two networks can talk to each other.
  • With DNS forwarding set up, I can lookup between each domain as long as I always use xxx.blue or xxx.yellow. For example:
    • If I'm on the Blue network and I want to look up a device named Camera on the Yellow network, I can do so by querying: camera.yellow

While this is great, I was hoping I could query "camera" without a domain and if it exists on the current domain I'd like that IP, and then I would like to check the other domains and have them respond if they have a device named "camera". This I can't get to work. I tried setting up the DNS Forwarding in Blue to use Yellow without a specific domain name (so I just put in the Yellow OpenWRT router IP running dnsmasq of 10.10.2.1). When I do this none of the resolution works - there is no IP returned for camera or camera.yellow. It's only if I set up the DNS forwarding to use the domains (e.g., /yellow/10.10.2.1) and subsequently ensure that I use camera.yellow in my query that it works from Blue.

Is this something that can be done using dnsmasq?

You can advertise the search domains to the clients with option 119.
https://www.rfc-editor.org/rfc/rfc3397.html

Just wanted to add that when using 119, at least for Windows clients, I had to add my default suffix as the first search domain or it would be skipped. Once I figured that out it all works well.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.