What DNS servers are used when connected to wireless data (not wifi)?

Is there a way within Android KitKat to tell?

  • Out of curiosity could you tell me why you're asking this? Is it to do with security/privacy concerns? Have you looked into DNSSEC/DNSCrypt? – warsong Dec 5 '14 at 21:36

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.

| improve this answer | |
  • Does running the command involve downloading a Terminal Emulator from the Play Store, or is there one built-in to stock Android? There are many apps in the Play Store claiming to be the real Terminal Emulator. If a download is required, is one of those considered to be the standard? – RockPaperLz- Mask it or Casket Dec 5 '14 at 17:55
  • There won't be many stock roms out there witb terminal emulators as standard, you will need to get one from Play. Get the one by Jack Palevich. Searching his name and terminal should get you there. – warsong Dec 5 '14 at 19:58
  • Thank you! Answer accepted! Given the info provided by m.chinni below, I decided that the website you provided is probably the best answer. Hopefully it is reliable. – RockPaperLz- Mask it or Casket Dec 5 '14 at 20:19

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]: []
[dhcp.wlan0.dns2]: []
[dhcp.wlan0.dns3]: []
[dhcp.wlan0.dns4]: []
[net.change]: [net.rmnet0.dns2]
[net.dns1]: []
[net.dns2]: []
[net.rmnet0.dns1]: []
[net.rmnet0.dns2]: []
[net.wlan0.dns1]: []
[net.wlan0.dns2]: []

To clarify my answer: using a terminal emulator app (like Terminal Emulator for Android), as a normal user (no root permissions needed), you can execute the command I showed (getprop | grep dns) and get an output like that.

| improve this answer | |
  • @mchinni Thanks. Can you enhance your answer to explain how and where to use that command? – RockPaperLz- Mask it or Casket Dec 5 '14 at 17:27
  • This just gives a list of DNS servers that are in the config, it doesn't tell you with any certainty which is in use. My method works better here imo. – warsong Dec 5 '14 at 20:08
  • @warsong You are right, but starting from Android 4.2 if you type nslookup google.com the Server line will be like Server: because the name resolution is performed locally and forwarded to the DNS only if needed. With getprop (which is not future proof), today you receive the current DNS values. – MaxChinni Dec 5 '14 at 20:18
  • @m.chinni Thank you. I was thinking I was doing something wrong. I gave your answer a +1 because it is also very useful. For now, I hope the website warsong provided is the most reliable. – RockPaperLz- Mask it or Casket Dec 5 '14 at 20:22
  • I agree. My commands show the configuration, but if your carrier perform some kind of DNS hijacking, with the site @warsong provided, you'll see the "real" DNS servers you are using. It's your choice the kind of information you need. – MaxChinni Dec 5 '14 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.