I’m using 4G by China Mobile, but the DNS it provides really sucks. Changing DNS from Cellular Data on a not-jailbroken iPhone is impossible so far as I know (I tried mobileconfig but can find any working options).
The first idea is pushing DNS from a PPTP server, which I wrote: Notes: PPTP/L2TP Server on Ubuntu.
I can create two connections on my iOS, one set default route, one not. All users share a same setting from PPTPd, it’s almost impossible if I want to use a different DNS in these two connections, changing default pptp port from 1723 to others is not as easy as it is on windows.
Don’t forget that PPTP is what GF*W likes.
Here is another option: OpenConnect
I have an OpenConnect server running on my VPS, which supports per user/group config, so that I can push a different DNS with a matched route line(if I really need it).
1 2 |
config-per-user = /opt/ocserv/etc/config-per-user/ config-per-group = /opt/ocserv/etc/config-per-group/ |
I have my vpn client name as ‘dnsonly’, so add a file /opt/ocserv/etc/config-per-user/dnsonly
The dns line in per user conf does not work as it’s said in manual, so I just add
1 |
dns = 8.8.8.8 |
to etc/config
EDIT: this has been fixed.
To make my vpn server as default route, I don’t add any route lines to etc/config, to make the vpn server work for dns only, and to keep dns from being polluted, route to 8.8.8.8 should not be forgot.
1 |
route = 8.8.0.0/255.255.0.0 |
All other routes for Google (Google IP Address Ranges):
1 2 3 4 5 6 7 8 9 10 11 |
route = 8.8.0.0/255.255.0.0 route = 216.239.32.0/255.255.224.0 route = 64.233.160.0/255.255.224.0 route = 66.249.80.0/255.255.240.0 route = 72.14.192.0/255.255.192.0 route = 209.85.128.0/255.255.128.0 route = 66.102.0.0/255.255.240.0 route = 74.125.0.0/255.255.0.0 route = 64.18.0.0/255.255.240.0 route = 207.126.144.0/255.255.240.0 route = 173.194.0.0/255.255.0.0 |