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.
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,...
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 --...
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 ...
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 ...
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
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
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 ...
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
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 ...
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 ...
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/...
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
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 ...
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 ...
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 ...
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.
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.
I'll try to explain my understanding of DNS on Android. It will help you troubleshoot related problems and serve me as future notes.
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 ...
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 ...
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.
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:firstname.lastname@example.org/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@...
The solution is further down the same page:
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 ...
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 \
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:
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 ...