Android subsystem doesn't use DNS provided by openvpn

It looks like the android subsystem doesn’t use the DNS provided by openvpn (or at least with my settings).

I’ve tested this by connecting to a DNS name known in the local DNS resolver (provided by pfsense) with the browser in SailfishOS and Firefox in the android subsystem. Using the IP address works for both, but when using the name only SailfishOS works.

Anyone an idea why this is the case? or what I’m doing wrong?

NOTE: tested with Xperia 10 III 4.4.0.64

2 Likes

I’ve figured out a workaround using a post called “Editing hosts & hosts.editable has no effect” talking about using hosts file for blackholing… It’s overriding DNS to use a local file first and therefor good for also placing in an usable address. So that’s what I did below to be able to use the Android Nextcloud Talk client to reach my internal Nextcloud Server.

# /var/lib/lxc/aliendalvik/extra_config
lxc.mount.entry = /etc/hosts system/etc/hosts none bind,create=file 0 0
# /etc/hosts
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
10.1.1.2        nextcloud.test

If I understand correctly the first part edits extra_config to connect the general /etc/hosts with the Android subsystem. To only remaining action is to hardcode the local host entry into /etc/hosts

Sometimes passing dhcp options like dns does not work well with OpenVPN. I have got problems esp. with SF and Windows.