OpenConnect DNS Only + Google Only

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).

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

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.

All other routes for Google (Google IP Address Ranges):

OpenConnect DNS Only + Google Only by @sskaje: https://sskaje.me/2014/06/openconnect-dns-google/

Incoming search terms: