Redirect dns traffic through wireguard

Started by pitoucol, December 18, 2025, 12:32:29 PM

Previous topic - Next topic
Hello

Is it possible to take unbound requests and send them back through a wireguard gateway? If so, what would be the method?
Could you help me build the rules and understand them?
I have a functional wireguard gateway, and unbound operational too.
Thank you

If you want to send any local DNS request to a local Unbound through wireguard to an upstream DNS, the easiest way is to use the documentation for wireguard selective routing (https://docs.opnsense.org/manual/how-tos/wireguard-selective-routing.html) and modify it to only tunnel DNS traffic from any firewall IP to the upstream DNS IPs.