Hello,I recently activated OpenVPN with policy based routing. It works all except DNS queryI'm using the following DNS settings:- System-> Settings -> General ->Networking ->DNS servers "8.8.8.8 / 8.8.4.4" - DNS server options "Allow DNS server list do be overridden by DHCP/PPP on WAN" -> UNCHECKED - Allow default gateway switching -> UNCHECKED- Services -> Unbound DNS -> General - DNS Query Forwarding -> Enable Forwarding Mode -> CHECKED - Local Zone Type > transparent - Outgoing Network Interfaces > All (recommended)DHCPv4 -> DNS servers -> BLANK -> USE SYSTEM DEFAULT DNS SERVERSProblem: clients routed through the vpn tunnel are not able to resolve DNS host names until I set the DNS servers manually or with DHCP. It seems that "DNS Query Forwarding" (Unbound DNS) ist not working.Is there an option and/or firewall rule that I'm still missing?best regards,Sarge
Unbound DNS works for me, using OPNsense 21.1.3_3-amd64. I'll describe my setup.The client is directly connected to the OPNsense box. The box is used as gateway (internet through OpenVPN) and DNS. To make the DNS work, I changed some Unbound DNS configuration:Enable: Enable Unbound: checkedNetwork Interfaces: selected the interface the client is connected onDNS Query Forwarding: Enable Forwarding mode: checkedOutgoing Network Interfaces: selected the OpenVPN interfaceI also added a firewall rule to the client's LAN interface, allowing incoming UDP:53 packets from the client's net to the LAN interface address.In this setup, the client sends his DNS requests to the OPNsense box, so that Unbound DNS forwards the requests to the DNS server(s) configured via general system settings (like "8.8.8.8 / 8.8.4.4" in your example).HTH
In your VPN Server configuration did you set up Unbound as your DNS server for the VPN clients? The clients connecting via VPN need to know the address of Unbound which is usually your opnsense IP.Also, since you are only using DNS forwarder, another option is to just use Dnsmasq instead of Unbound with Query Forwarder Mode
Unbound DNS works for me, using OPNsense 21.1.3_3-amd64. I'll describe my setup.I also added a firewall rule to the client's LAN interface, allowing incoming UDP:53 packets from the client's net to the LAN interface address.In this setup, the client sends his DNS requests to the OPNsense box, so that Unbound DNS forwards the requests to the DNS server(s) configured via general system settings (like "8.8.8.8 / 8.8.4.4" in your example).HTH
In the evening suddenly for the other hosts (that goes directly in the internet) DNS query for some websites (amazon) did not work anymore. This ist the first time I have this kind of problem. After I set the custom DNS with DHCP it worked again. Can this issue be Unbound DNS related?
Are you asking why different nameservers provide different results for the same query?
I missed something here. Are you using OPNsense only as OpenVPN client or also as OpenVPN server?