Team-BHP > Shifting gears > Gadgets, Computers & Software
Register New Topics New Posts Top Thanked Team-BHP FAQ


Reply
  Search this Thread
1,924 views
Old 18th February 2024, 22:28   #1
BHPian
 
Join Date: Mar 2009
Location: Palakkad
Posts: 61
Thanked: 170 Times
Changing the DNS server for mobile data connection

I hope it is ok to start a new topic. Otherwise I request mods to move it to an appropriate thread.

I am looking for clarifications on :

1. Is it possible to change the dns server for mobile data connection in an android phone? Search on web returns hundreds of results, but they all talk about setting dns for wifi connections.

2. How can I find the dns server I am currently using? I mean something like whatismyip.com (for ip address) to show the dns server in use. Checking the phone settings is not what I mean.

Thanks
9216 is offline   (1) Thanks
Old 18th February 2024, 22:47   #2
BHPian
 
Join Date: Apr 2020
Location: New Delhi
Posts: 117
Thanked: 268 Times
re: Changing the DNS server for mobile data connection

On recent Android versions, you can do that. Works over mobile data. Go to network and internet, then private dns. Enter the hostname and you're done
lxskllr is offline   (3) Thanks
Old 18th February 2024, 23:00   #3
BHPian
 
Join Date: Dec 2014
Location: Hyderabad
Posts: 165
Thanked: 164 Times
re: Changing the DNS server for mobile data connection

You can change the DNS in network settings. It applies for both wifi and mobile data.
JonSnow is offline   (2) Thanks
Old 18th February 2024, 23:17   #4
BHPian
 
Join Date: Mar 2009
Location: Palakkad
Posts: 61
Thanked: 170 Times
re: Changing the DNS server for mobile data connection

Thanks lxskllr andJonSnow.
I am not sure that works. I have set cloudfare (1.1.1.1) as my dns. On checking network info, this is what I see.
Attached Thumbnails
Changing the DNS server for mobile data connection-img_20240218_230834.jpg  

9216 is offline   (1) Thanks
Old 19th February 2024, 09:26   #5
Senior - BHPian
 
hserus's Avatar
 
Join Date: Sep 2014
Location: Chennai
Posts: 4,957
Thanked: 9,163 Times
re: Changing the DNS server for mobile data connection

Cellular connections will automatically override the dns settings and this cannot be changed. DNS for your WiFi is another matter altogether.
hserus is offline   (2) Thanks
Old 22nd February 2024, 02:06   #6
Senior - BHPian
 
ph03n!x's Avatar
 
Join Date: Jun 2008
Location: Coimbatore
Posts: 2,566
Thanked: 5,986 Times
Re: Changing the DNS server for mobile data connection

Quote:
Originally Posted by 9216 View Post
Thanks lxskllr andJonSnow.
I am not sure that works. I have set cloudfare (1.1.1.1) as my dns. On checking network info, this is what I see.
First off, test your DNS at https://www.dnsleaktest.com/ and not in network info. Network info will show what the DHCP server assigned when your phone connected to the network, and not your private DNS config

Secondly, private DNS for cloudflare is not 1.1.1.1, it is 1dot1dot1dot1.cloudflare-dns.com
ph03n!x is offline  
Old 22nd February 2024, 05:55   #7
Senior - BHPian
 
hserus's Avatar
 
Join Date: Sep 2014
Location: Chennai
Posts: 4,957
Thanked: 9,163 Times
Re: Changing the DNS server for mobile data connection

Quote:
Originally Posted by ph03n!x View Post
First off, test your DNS at https://www.dnsleaktest.com/ and not in network info. Network info will show what the DHCP server assigned when your phone connected to the network, and not your private DNS config

Secondly, private DNS for cloudflare is not 1.1.1.1, it is 1dot1dot1dot1.cloudflare-dns.com
Yes that 1dot1dot etc is the hostname that maps to the IP 1.1.1.1

You'll still set the IP as your nameserver, rather than the hostname because, to actually resolve the hostname 1dot1dot1, you need to look it up against a nameserver .. becomes rather chicken and egg when you have to resolve the nameserver before attempting a dns resolution. Which is why the IP is specified instead.
hserus is offline  
Old 22nd February 2024, 08:24   #8
Senior - BHPian
 
SunnyBoi's Avatar
 
Join Date: Dec 2006
Location: Mysore / B'lore
Posts: 1,675
Thanked: 4,157 Times
Re: Changing the DNS server for mobile data connection

Quote:
Originally Posted by lxskllr View Post
On recent Android versions, you can do that. Works over mobile data. Go to network and internet, then private dns. Enter the hostname and you're done
If anyone is going this route, might as well install AdAway. Allows you to customise your DNS and provide systemwide ad blocking.

https://github.com/AdAway/AdAway

AdAway is mandatory on all my + family phones.
SunnyBoi is offline   (1) Thanks
Old 22nd February 2024, 09:49   #9
BHPian
 
anandbangalore's Avatar
 
Join Date: Jul 2011
Location: Bangalore
Posts: 57
Thanked: 43 Times
Re: Changing the DNS server for mobile data connection

Quote:
Originally Posted by 9216 View Post
I hope it is ok to start a new topic. Otherwise I request mods to move it to an appropriate thread.

I am looking for clarifications on :

1. Is it possible to change the dns server for mobile data connection in an android phone? Search on web returns hundreds of results, but they all talk about setting dns for wifi connections.

2. How can I find the dns server I am currently using? I mean something like whatismyip.com (for ip address) to show the dns server in use. Checking the phone settings is not what I mean.

Thanks
Googles 'Private DNS' does exactly that - where you can control what dns service to use. The DNS service you choose needs to support 'dns over tls'. A good starting point is CloudFlares multiple services
1. PRIVATE DNS https://developers.cloudflare.com/1....setup/android/
2. VPN - 1.1.1.1 available in the app Store.
3. Privacy for home incl Porn content filtering -
anandbangalore is offline   (1) Thanks
Old 22nd February 2024, 09:52   #10
BHPian
 
anandbangalore's Avatar
 
Join Date: Jul 2011
Location: Bangalore
Posts: 57
Thanked: 43 Times
Re: Changing the DNS server for mobile data connection

Quote:
Originally Posted by SunnyBoi View Post
If anyone is going this route, might as well install AdAway. Allows you to customise your DNS and provide systemwide ad blocking.

https://github.com/AdAway/AdAway

AdAway is mandatory on all my + family phones.
I don't mean to start a side topic than what OP asked, but 'thoroughly trust' Anyone in the way of your family's devices and the Internet. Including your WiFi router, the dns service provider, or any 'VPN' styled apps installed on your devices.
anandbangalore is offline  
Old 22nd February 2024, 10:23   #11
BHPian
 
Join Date: Jun 2015
Location: Hyderabad
Posts: 85
Thanked: 282 Times
Re: Changing the DNS server for mobile data connection

You have many options to change DNS for both wifi and mobile.

1) Installing app and setting up DNS. Cloudfare warp, intra( you can choose your DNS provider)

2) On Android, you can set it in Private DNS. Search for DNS in settings. It works for both mobile and wifi.

I personally use nextdns at router level and tailscale app on Android and iOS device for DNS blocking.
atulsian is offline  
Old 24th February 2024, 00:13   #12
Senior - BHPian
 
ph03n!x's Avatar
 
Join Date: Jun 2008
Location: Coimbatore
Posts: 2,566
Thanked: 5,986 Times
Re: Changing the DNS server for mobile data connection

Quote:
Originally Posted by hserus View Post
Yes that 1dot1dot etc is the hostname that maps to the IP 1.1.1.1

You'll still set the IP as your nameserver, rather than the hostname because, to actually resolve the hostname 1dot1dot1, you need to look it up against a nameserver .. becomes rather chicken and egg when you have to resolve the nameserver before attempting a dns resolution. Which is why the IP is specified instead.
Hey! You're talking about traditional DNS. What I'm specifying is Private DNS - aka DNS-Over-TLS - as a easy way to change the DNS server across various OS (incl. Android 9+ and iOS 14+)

Traditional DNS server queries are unencrypted UDP queries - anyone from the ISP to "interested parties" can monitor all DNS queries for whatever reasons and purposes

With private DNS setup, Android will lookup the Private DNS server address through traditional (unencrypted) DNS when the mobile data (or WI-FI) connection is established. After that, it'll route all DNS queries this private server with TLS encryption.

Some more resources for your reference on this topic -

Cloudflare blog.
DNS vs. Encrypted DNS
iOS configuration for encrypted DNS
Google (8.8 8.8 - equivalent) encrypted DNS

If you specify a traditional DNS server address in Private DNS, there is no encryption (I have not checked if the query actually goes to the server name specified here or to the ISP).

This is what my setup looks like -

Changing the DNS server for mobile data connection-screenshot_20240223_102601_settings.jpg

Try one of this server in your mobile phone and visit https://dnsleaktest.com/ to check which DNS server is used (do a before/ after).

This is without private DNS (I'm currently traveling, and this shows my ISP's DNS config) -

Changing the DNS server for mobile data connection-screenshot_20240223_104813_firefox.jpg

This is with Private DNS enabled -

Changing the DNS server for mobile data connection-screenshot_20240223_104854_firefox.jpg

My home router (running OpenWRT) has DNS-over-TLS enabled through dnscrypt for the same objective - resolve the secure DNS server with ISP or custom (unencrypted) DNS, and then route all DNS traffic through secure DNS...

Last edited by ph03n!x : 24th February 2024 at 00:24.
ph03n!x is offline  
Old 24th February 2024, 07:58   #13
BHPian
 
Join Date: May 2022
Location: Chandigarh
Posts: 169
Thanked: 316 Times
Re: Changing the DNS server for mobile data connection

On Android phones, Settings > Network> Private DNS
Enter " 1dot1dot1dot1.cloudflare-dns.com " or " dns.adguard.com "

On iOS devices, use this tool "
https://simpledns.plus/apple-dot-doh " to create DNS profile.
attinder is offline   (1) Thanks
Old 28th February 2024, 21:52   #14
BHPian
 
Join Date: Mar 2009
Location: Palakkad
Posts: 61
Thanked: 170 Times
Re: Changing the DNS server for mobile data connection

Thanks for the very useful responses. The site https://dnsleaktest.com/ is exactly what I was looking for in my original query. I can now verify that setting private dns indeed works for wifi as well as mobile data.

Taking the virtual vpn route to set dns is not convenient for me, because I am using Netguard to limit internet access to selected apps (it uses virtual vpn). I understand that only one virtual vpn can be active at a time.
9216 is offline   (1) Thanks
Reply

Most Viewed


Copyright ©2000 - 2024, Team-BHP.com
Proudly powered by E2E Networks