R. Gerrits
Very Senior Member
I was today looking to improve the Wireguard init-script.
Discovered an issue with DNS:
My router is configured to get DNS servers from my ISP using DHCP.
The moment WG becomes active, the router thus tries to access these DHCP servers through the tunnel.
And my provider blocks access to their DNS servers for devices that are not on their network.
Any suggestions on how we could best solve this?
(didn't notice it before, because I usually bypass VPN for the router itself. )
We could get the ip-addresses of the dns-servers from /etc/resolv.conf and add specific routes for those to the routing table to still route these directly via internet.
But if someone has manually configured for instance 9.9.9.9, then perhaps that user does want to have his DNS-traffic running through the WG tunnel?
And perhaps some WG providers also provide DNS servers to use?
(I see WG client config can have DNS server entry, but current init-script would completely ignore that).
Discovered an issue with DNS:
My router is configured to get DNS servers from my ISP using DHCP.
The moment WG becomes active, the router thus tries to access these DHCP servers through the tunnel.
And my provider blocks access to their DNS servers for devices that are not on their network.
Any suggestions on how we could best solve this?
(didn't notice it before, because I usually bypass VPN for the router itself. )
We could get the ip-addresses of the dns-servers from /etc/resolv.conf and add specific routes for those to the routing table to still route these directly via internet.
But if someone has manually configured for instance 9.9.9.9, then perhaps that user does want to have his DNS-traffic running through the WG tunnel?
And perhaps some WG providers also provide DNS servers to use?
(I see WG client config can have DNS server entry, but current init-script would completely ignore that).