Is it possible to change DNS for cellular internet? How can it be done without a jailbreak?
I've tried Apple Configurator, but didn't find suitable settings.
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Build your own VPN using OpenVPN & easy-rsa on a digital ocean cloud server ($5/mo for cheapest VM & 2TB monthly transfer), configure VPN to tunnel/forward all traffic, set up Cloudflare 126.96.36.199 on VPN, then use Apple Configurator to set an always on VPN connection.
Can confirm this is how I do it, I set up Ubuntu 16.04 server instance and the above and never shut my vpn off.
NOTE: Depending on your Mobile ISP, this may not work for a tethered device. i.e. a laptop tethered to your mobile phone (via hotspot) often does NOT have it's DNS passed through this tunnel and instead will use the ISP supplied via the Cellular config.
Not possible without a jailbreak.
Source: iPhone Configuration for OpenDNS It says, in part (emphasis mine):
"These instructions only work for Wi-Fi connections because iOS does not allow you to change the DNS servers when connected to cellular networks. Also, the changes are network specific, so you'll need to change the DNS servers every time you connect to a new wireless network."
These folks surely know more about DNS (and in particular overriding standard settings) than anybody else.
The app sets up a VPN profile that automatically routes all DNS queries from any app through Cloudflare's free DNS servers.
Cloudflare's servers will be used, even for cellular data.
You can also use a third party iOS app called DNS Override (paid app, costs $1.99) that automatically configures 188.8.131.52 for you on any network you connect to. Directions from Cloudflare can be found here and are referenced below:
Launch the DNS Override app.
Click 184.108.40.206 at the top of the app.
Turn on the DNS Override toggle
DNS Override may ask you to install their VPN profile so that they can automatically update DNS settings.
Lastly, wifi users can setup DNS servers manually by going to the iOS wifi settings. Note your device will only use 220.127.116.11 for each wifi connection you configure.
Go to Settings.
Click on Wi-Fi.
Click the information ‘i’ icon next to the Wi-Fi name you are connected to.
Scroll down until you see the section called Configure DNS
Change the configuration from Automatic to Manual.
Click Add Server.
Remove any IP addresses that may be already listed and in their place add:
18.104.22.168 22.214.171.124 2606:4700:4700::1111 2606:4700:4700::1001
I can't think of a good reason to pay for a third party app like DNS Override when an official app is provided free directly from Cloudflare.
For those using a manual Wifi configuration, know that Cloudflare's DNS is not used for your cellular data. Your iOS device will only use a custom DNS on connections that have it configured. There is not a way to configure cellular DNS on iOS at this time - your carrier settings will be used. For this reason, I suggest using the official Cloudflare app.
For iOS 14, I recommend using the DNS profiles from paulmillr. Simply install the corresponding profile of the desired DNS provider.
Download the profiles here: https://github.com/paulmillr/encrypted-dns
After installation, the DNS settings are active system-wide, regardless of whether via WiFi or mobile data. Another advantage of this is that the DNS queries are encrypted. Either via HTTPS (DoH) or TLS (DoT).
In my opinion, this is the best way to change your DNS.
it's an old entry, but maybe someone found it when looking for how to change the DNS server on the iPhone.
I have found for me a more dynamic variant. A WireGuard-Pseudo-VPN can be used to assign DNS to all (or "included" or "without excluded" SSIDs): Simply set up a new connection and set up 127.0.0.1 as server. Then specify the DNS server under DNS separated by commas. Thats all – no VPN-Server or special app (except WireGuard) needed. You can switch on or off your specialized DNS/DoH-Server by hand or on demand.
So you can even use mobile DNS over HTTPS on cellular, quad9 for example. 😃
DNS Override worked for me on the tests, although I noted some bad reviews around battery life. Having a quick look at doing this via a profile and Apple Configurator software, seems you can set-up a profile with proxy DNS settings, but the profile just allows you to refer to a bundle within an iOS application. Looks like you do need an app like DNS Override in order to change cellular DNS, and can't be done through profile on it's own.
Would be very happy to be proved wrong on this. (iOS 11/8 Plus)
The suggestions by @cinematicme got me on my way; super helpful. Here is what I am running: iOS OpenVPN app tunnels to Azure Ubuntu server, app set to only activate on cellular. DNS Override app makes all WiFi connections use my preferred DNS (OpenDNS). My home network and Azure server are in my OpenVPN account with custom blocking rules.
1) Create cloud server in Azure (or DigitalOcean) with UDP port 1194 open; Azure burstable B1s size costs me $9/mo, 25GB bandwidth costs $1.75/mo
3) Install OpenVPN using comment at above link, here it is directly:
wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh
Can read the script on GitHub here before installing.
The install script will ask you what DNS you want to use for your VPN. You can choose 126.96.36.199, Google, or OpenDNS.
4) Import the .ovpn file generated above into the iOS OpenVPN app, set to continuously reconnect on cellular only.
5) Bonus: I wanted OpenDNS on all WiFi connections as well, which can be accomplished via iOS DNS Override app ($1.99). I set this to force OpenDNS for all WiFi and cellular connections. It does not seem to conflict with the autoconnected VPN on cellular opened by the OpenVPN app.
Hopefully this helps someone with their private cellular data needs. What took me a day to set up could have taken just a couple hours with the right information. Like @spinalwrap mentioned, a nice bonus of the actual VPN method is your cellular provider has none of your metadata.
I also installed the 188.8.131.52 app and it worked to get 184.108.40.206 DNS, but since I wanted OpenDNS and filtering, I opted for the VPN route.
Try this app : DNS Override set DNS for Wi-Fi and cellular