38

We recently released an android application that pulls information from an external server. Last week we moved from shared hosting to a dedicated server, that went smoothly up until we started getting complaints that users were getting server not found errors. We checked on our android-based phones (Droid) and everything worked fine. The vast majority of users are fine, there seems to be a small percentage of t-mobile users running android o/s 1.5 (g1, mytouch 3g) that seem to be having trouble. We believe these are all previous users of the application.

Anyway, we've been trying to find a fix (similar to ipconfig /flushdns) but have been unable to do so. Has anyone had experience with something similar to this? Thanks.

user254919
  • 391
  • 1
  • 3
  • 4

3 Answers3

23

You have a few options:

  • Release an update for your app that uses a different hostname that isn't in anyone's cache.
  • Same thing, but using the IP address of your server
  • Have your users go into settings -> applications -> Network Location -> Clear data.

You may want to check that last step because i don't know for a fact that this is the appropriate service. I can't really test that right now. Good luck!

loginx
  • 1,112
  • 9
  • 9
  • We were trying away from pushing out another update, but we ended up just using the IP address and pushing an update. Thanks! – user254919 Jan 21 '10 at 13:24
18

copied from: https://android.stackexchange.com/questions/12962/flush-clear-dns-cache

Addresses are cached for 600 seconds (10 minutes) by default. Failed lookups are cached for 10 seconds. From everything I've seen, there's nothing built in to flush the cache. This is apparently a reported bug http://code.google.com/p/android/issues/detail?id=7904 in Android because of the way it stores DNS cache. Clearing the browser cache doesn't touch the DNS, the "hard reset" clears it.

Community
  • 1
  • 1
Slavik
  • 1,488
  • 1
  • 15
  • 24
0

Perform a hard reboot of your phone. The easiest way to do this is to remove the phone's battery. Wait for at least 30 seconds, then replace the battery. The phone will reboot, and upon completing its restart will have an empty DNS cache.

Read more: How to Flush the DNS on an Android Phone | eHow.com http://www.ehow.com/how_10021288_flush-dns-android-phone.html#ixzz1gRJnmiJb

Chris
  • 71
  • 1
  • 1
    Ummm, why was this voted down 3 times? It's a legit answer that is likely to work. – Eduard Luca Feb 28 '13 at 17:03
  • I would imagine it was voted down because the OP was looking for a programmatic way to resolve the problem. That is, if your app gets an UnknownHostException, taking some corrective action and then retrying is a better response than hanging, crashing, or saying I'm Afraid I Can't Do That, Dave. – Jon Shemitz Feb 25 '14 at 20:16
  • Then programatically request a reboot of the phone? Short of a rooted system, there really isn't a call to interface with the DNS resolution. The other option is to statically set the IP address of the server in the app, and update that. But that sort of defeats the purpose of having a host name to begin with. – Alex Summers Aug 21 '15 at 22:03
  • A soft reboot is enough (i.e. `killall zygote`). A full reboot - and worse yet, taking the battery - really accomplishes *nothing* here. – Marc.2377 Dec 18 '19 at 03:42
  • As of May 2022, on my Samsung Galaxy S10e, the UI in that article no longer exists. The net-internals tab says the functionality has been removed. – enigment May 17 '22 at 17:58