How to set a DNS server for the tunnel on iOS???
-
I am experimenting with WireGuard as a 'better' VPN solution for my client population compared to IPsec.
I have got WireGuard working (it was surprisingly easy) and it tunnels both IPv4 and IPv6 nicely. My problem is DNS resolution from the client. WireGuard doesn't; appear to have any mechanism to pass DNS server settings over to the client so somehow they must be set at the client side.
For macOS clients this isn't a huge deal since one can set up some additional 'resolvers' for the relevant private network domains under /etc/resolver and that takes care of that.
However for iOS clients (iPhone and iPad) there is no way on the client side to specify a DNS server for the VPN connection (tunnel) so all DNS queries go to the DNS servers for the underlying network connection (in a plot tunnel situation). Given that the DNS server for the underlying network connection (could be public WiFi, could be mobile network, could be Google or CloudFlare servers, ...) cannot of course resolve any hosts on my private network, once the VPN is connected the device has zero DNS resolution capability.
Even if I set WireGuard to tunnel all traffic it still doesn't because again I can't set any DNS server for the tunnel so it still tries to use the servers for the underlying connection which results in the same problem.
Has anyone got any ideas for solving this?