Hi,
I need help with setting up conditional DNS forwarding on Unbound.
I have 3 networks connected via WireGuard tunel, with static routes between them. Clients are able to reach each other via IP, but I would also like to get DNS working, so they are reachable via domain names.
Network looks like this:
Router & DNS - Local Domain
- 10.10.0.1 = a.example.com
- 10.20.0.1 = b.example.com
- 10.30.0.1 = c.example.com
What I want to do is to forward all queries for *.a.example.com to 10.10.0.1 so client.b.example.com can reach client.a.example.com
Routed "b" runs Knot Resolver and configuration was just single line in the config file (below). I guess for Unbound it should be similar, but no idea what that should look like.
policy.add(policy.suffix(policy.FORWARD(‘10.10.0.1’), {todname(‘a.example.com.’)}))
policy.add(policy.suffix(policy.FORWARD(‘10.30.0.1’), {todname(‘c.example.com.’)}))
Thanks in advance