schwabe / ics-openvpn

OpenVPN for Android
3.31k stars 1.19k forks source link

Split tunnel configuration fails to split DNS requests #1513

Closed fran-penedo closed 2 years ago

fran-penedo commented 2 years ago

General information

  1. Android 12
  2. Samsung
  3. S21
  4. Play store (0.7.37)

Description of the issue

In a split tunnel configuration, I'm pushing a DNS that only resolves local addresses for a domain. The relevant configuration options in the server are:

push "dhcp-option DNS 10.111.0.1" 
push "dhcp-option DOMAIN lan"

This configuration works fine with a Linux client: *.lan and unqualified hosts are resolved in the DNS at 10.111.0.1, while everything else is resolved with the existing DNS for the connection (for example 1.1.1.1). However, in Android the local addresses work fine, while everything else fails. If I try to override the DNS configuration pulled from the server in the app so that both 10.111.0.1 and 1.1.1.1 are used, whichever DNS I use as primary is the only one queried; if it fails to resolve, the secondary is not used. As far as I can understand, the existing DNS servers are fully overridden by the VPN connection and at no point queried.

Is it at all possible to split DNS like this in Android? If not, would it be possible to, at the very least, try the secondary DNS if the primary can't resolve?

Thanks.