More permanent way of fixing DNS

79 views
Skip to first unread message

Peter Durcansky

unread,
Dec 1, 2012, 12:03:21 AM12/1/12
to android-open...@googlegroups.com
I've installed OpenVPN Settings and I am very happy with it. Thanks for your hard work. I use Android 2.3.6 connecting to my Tomato router running OpenVPN server.

I use "dhcp-option DNS <my.vpn.ip>,redirect-gateway def1" settings pushed from the server and "Use VPN DNS Server" option in the application. It works if I start the tunnel after getting the wifi connection. However, it seems that every time I (re-)join a wifi network, it wipes the DNS server settings (forces its own DNS to net.dns1). I know I can use the "Fix DNS" option of OpenVPN Settings but that is unsustainable. I go in and out of range often (2-3 times per hour). If I forget to check, I essentially lose connectivity because I am redirecting all traffic via the tunnel and my DNS server (pushed by the wifi network) is inaccessible when using the tunnel.

Is there an easy solution? Ideally, the OpenVPN Settings application could register/listen to the wifi network change and apply/force its DNS server every time the wifi network is connected. I learned that the equivalent command is "setprop net.dns1 <new.ip.address>". I saw a few Java examples on how to get notified about wifi network notifications.

However, I'd be happy with any workaround, for example using some logical equivalent of up or down script like OpenVPN (I am fully aware that this would be not in OpenVPN but in the wireless app/settings). Are there some custom/different wireless setting apps that would let me plug in custom action/command when I connect to certain network?

Another possibility would be for me to tweak the routing tables to add route for the DNS server (route all but DNS traffic via the tunnel). I have no idea if/how that would be possible.

I am pretty new to this; I would appreciate any advice/pointers.

Bonus: a feature request: I only need/use OpenVPN for this one wifi network (it is inside corporate firewall so I need OpenVPN to access IMAP, SMTP, VoIP ports). It would be great if I could connect/link OpenVPN to a single wifi network - so connecting to that network would automatically start the tunnel; disconnecting from the wifi would turn it off.

Thank you for your time and help,
Peter

Peter Durcansky

unread,
Dec 7, 2012, 1:25:24 PM12/7/12
to android-open...@googlegroups.com
I investigate some more. I no longer think OpenVPN Settings app is doing anything wrong.

I think this is purely strength of signal issue. As I walk through the building (large workplace building that houses some 3,000+ people) the access points are handing the phone over. The signal is probably weak in the hallways and stairwells. So the wi-fi gets dropped. The signal is too weak/marginal to be reestablished. I tested several keep-alive settings (native or via the wi-fi keepalive app). Again, I do not think sleeping is a problem; just the signal strength.

When wi-fi is re-connected, I see that OpenVPN settings kicks in. So the DNS appears to be correct since the tunnel is refreshed after wi-fi is connected. I remember seeing the "wrong" DNS server address a few weeks ago; now it is correct.

I have not sudied the logs; just observed the phone behavior. For now, I believe the app works as it should. If the problem returns I'll post an update here.

Thank you for a great app,
Peter
Reply all
Reply to author
Forward
0 new messages