Hot answers tagged

18

Ok, first of all full disclosure: I'm the author of an app which is now on the Google Play Store and which makes you able to change DNS for any mobile connection on Android 4.4. The app requires root, costs a couple of bucks and is called Override DNS. I was told, on a now deleted answer, that is fair to link to my app as long as I expose it clearly. The ...


17

I did not find a way to reliably do it without an app. I often use OpenDNS Family Shield, but sometimes it blocks me to visit some particular hacking site and then I need to quickly and easily change the DNS servers. I used to use Set DNS but it stopped to work in Android 4.3 and further, so I created Override DNS, a new app which mimics Set DNS' behaviour,...


13

I "solved" this problem by using an iptables rule to forward all port 53 connections to an intended DNS server; my experience on Android 4.4.2 with attempting to modify DNS settings while connected to 3G has been exactly as Leo described; ignorance of values in getprop |grep dns[0-9]\]: and dhcpd.conf. iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --...


13

Pardon me if I fail to sum up the vast subject in a brief answer :) SELINUX AND AVC DENIALS Android is based on Linux kernel that makes use of Discretionary and Mandatory Access Controls (DAC, MAC) to restrict access to system resources such as files on a certain filesystem. DAC includes classic UNIX RWX file modes, owner/group or UID/GID, Extended ...


7

I ended up manually changing my DNS server to tether Internet from my mobile phone. My phone uses a local DNS server from my mobile carrier which I was able to trace using CompruebaIP. Any other DNS server is blocked by my mobile carrier (Globe Telecom). I reckon that my phone's DNS service is not properly working. When tethering, the DNS provider should be ...


7

You cannot simply edit the hosts file on Android, as it resides on a read-only file system: /system/etc/hosts, see: How to edit etc/hosts file How to change the hosts file on android Alternatives are: use a DNS server like DNSMasq in your local network to take care for that "centrally" use "root powers" to force-edit the system file as described above ...


7

Regardless whether you're connected to your local network via WiFi and DHCP is in use, Android always seems to override its DNS entries using Google's servers. It's somewhat hidden, but easy to change – provided you have your own DNS running (a lot of routers offer that already). To do so, go to your list of WiFi networks in Settings, long-press your WiFi's ...


6

While the setprop method to change DNS does not work, the getprop method to read those values should be still valid today: shell@A0001:/ $ getprop | grep dns [dhcp.wlan0.dns1]: [192.168.1.1] [dhcp.wlan0.dns2]: [] [dhcp.wlan0.dns3]: [] [dhcp.wlan0.dns4]: [] [net.change]: [net.rmnet0.dns2] [net.dns1]: [208.67.222.123] [net.dns2]: [208.67.220.123] [net.rmnet0....


5

There're also apps like Internet Booster promising to "clear DNS cache" (amongst other things). I didn't try it out myself, and furthermore there seems no way to do only that (just one "optimize" button which "applies improvements"); also its effects might differ between devices (says the app's description) -- but it might be better than a reboot. Btw: while ...


5

Starting with Android 9 Pie it is possible to change DNS globally, provided they support TLS. Just go in Settings → Network & internet → Advanced → Private DNS


5

We recently encountered this issue, and we narrowed it to occurring ONLY on devices running Android v5 and newer. Android v4 and all other OS's have no issue. With that tidbit, we determined that Android v5 and newer insists on using IPv6 for DNS name resolution. (Since we've completely disabled IPv6 on our network, this jibes with the issue.) If Android ...


5

How DNS queries made by a program are being resolved isn't specific to an OS, but depends on the resolver library the program is using. DNS resolvers have traditionally been part of OS's standard C library e.g. Bionic on Android, libcmt on Windows, glibc, musl, dietlibc, uClibc and others on Linux. Not all C libraries use the same approach to resolve host/...


4

I have been using the free SSHelper (without rooting) since it recently added zeroConf broadcasting. It provides an SSH and RSYNC (file transfer) server, while also broadcasting a ZeroConf name. Another avahi/bonjour client can connect without needing to know the android hostname. Explained in more detail in this other answer: Set hostname for SSHelper


4

First, without DNS the network connection won't be much helpful to you: you will need DNS to resolve host names to IPs – or entering something like www.google.com into the browser's address bar will just give you an error. Which does not mean you cannot use a DNS server other than Google's. From your homescreen: Press the Menu key, select Settings Go to ...


3

Run "nslookup google.com" from Terminal Emulator and the first result should be your DNS. Also you could run a standard test from dnsleaktest.com from your browser. Edit: I just noticed this answer is kind of outdated for newer Androids because nslookup doesn't seem to run if you install Terminal Emulator. The modern method seems to be to install ...


3

I am leaving my old answer since the browse and parsing examples may still be useful for some people. Thanks to the developer's version 5.5 update to SSHelper, you can create a user defined name to be the phones Zeroconf instance name. SSHelper will run the SSH server on a non-rooted Android. Update SSHelper to version 5.5 Open Android Bluetooth settings ...


3

In the March 2014 update to SSHelper the documentation states new changes to it's Zeroconf broadcasting name. In the documentation Configuration section of the details it describes the checkbox to "Enable Zeroconf broadcasting". When this is enabled any other client on the local network, will be able to browse and then connect for SSHelper on the network. ...


3

This info is from 2014. But it might still work. I am not in the position to test it at the moment, but since you are rooted. You could try adding the dns settings to the build.prop file and see if it sticks. Adding the following to the build.prop file should add google as your DNS server. net.rmnet0.dns1=8.8.8.8 net.rmnet0.dns2=8.8.4.4 net.dns1=8.8.8.8 ...


3

I'll try to explain my understanding of DNS on Android. It will help you troubleshoot related problems and serve me as future notes. DNS Domain Name Resolver has traditionally been a part of OS's C library (commonly called libc). GNU libc (which is most common on Linux distros) implements a complicated name resolution mechanism named NSS which can ...


3

There are a few options you can go with: Enter IP address directly (with port 80 or 443) to web browser's address bar instead of domain name. But this won't work if web server relies on host header or SNI for virtually hosting multiple websites on same IP address. It's possible to use VpnService API of Android to capture all DNS traffic without rooting ...


2

I have yet to find a way to create a hostname for an Android device. What I have done is that I set an IP reservation for my phone, so that every time I go to use SSH (I use QuickSSHd, but it should work for SSHelper) you can at least point to the same IP address. There is no way to set a host name for the phone, that I have found.


2

The very-originally-named Dynamic DNS Client is a fairly popular app for this purpose. As for service, noip is popular, free, and reliable in my experience.


2

In modern versions of Android there is an option to clear Chrome's DNS cache under chrome://net-internals/#dns


2

Just to add an up-to-date answer, I wrote an App which changes the DNS of both Wifi and mobile connections also without root. Have a look at PlayStore or Amazon.


2

When I needed to change my DNS the solution was always SETDNS. It's light, fast and user-friendly. Be aware that if your phone isn't rooted SetDNS will only modify WiFi' DNS settings...


2

OK, I know I'm way late, but here's an alternative I'd like to share that may be of help. Just open your browser at https://email:password@updates.opendns.com/nic/update?hostname=your_opendns_network_label to update your IP -- and that's it. On the email part, use "%40" as an @ and "%2E" as a dot, ie, write "someone%40somewhere%2Ecom" instead of "someone@...


2

The solution is further down the same page: https://github.com/jedisct1/dnscrypt-proxy/issues/98#issuecomment-62636551 I had a problem flashing the zip (made by qwerty12) in the link so you may need to extract the contents to the relevant directories (in /system) and make sure they have the correct permissions. I used Fx explorer for this. You obviously ...


2

As mentioned by lzzy, you can use DNSMasq server to achieve this. But Chrome uses own DNS resolving process and this method may not work. To start the server use the following command: sudo /usr/local/sbin/dnsmasq -d \ --no-hosts \ --no-resolv \ --conf-file=/dev/null \ ...


2

This is one silly issue in Lollipop update (CM12) for OnePlus. I'm assuming you're running Cyanogen OS 12, and I found (on Reddit) and tested this solution some time ago. Unlike Kitkat, you can't change only the DNS in Wifi settings as "Save"/"OK" is always greyed out if you do, i.e. you need to provide every single detail which includes: IP address ...


2

You can modify the network config to set a specific DNS value. Find the WiFi network you are connected to, press and hold on the name of the netowrk->Modify Network Config->Show Advanced Options. From here you can set a specific DNS, after changing the IP Settings to static. I believe that most devices look at the DHCP for a DNS server, with a google IP ...


Only top voted, non community-wiki answers of a minimum length are eligible