Android:刷新 DNS
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2101762/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android: Flush DNS
提问by user254919
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.
我们最近发布了一个从外部服务器获取信息的 android 应用程序。上周我们从共享主机转移到了专用服务器,直到我们开始抱怨用户收到服务器未找到错误为止,这一切都很顺利。我们检查了基于 android 的手机 (Droid),一切正常。绝大多数用户都很好,似乎有一小部分运行 android o/s 1.5(g1,mytouch 3g)的 t-mobile 用户似乎遇到了问题。我们相信这些都是该应用程序的先前用户。
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.
无论如何,我们一直在尝试找到修复程序(类似于 ipconfig /flushdns),但一直无法做到。有没有人有过类似的经历?谢谢。
采纳答案by loginx
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.
- 为您的应用发布更新,该更新使用不在任何人的缓存中的不同主机名。
- 同样的事情,但使用您服务器的 IP 地址
- 让您的用户进入设置 -> 应用程序 -> 网络位置 -> 清除数据。
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!
您可能想检查最后一步,因为我不知道这是合适的服务。我现在无法真正测试。祝你好运!
回答by Slavik
copied from: https://android.stackexchange.com/questions/12962/flush-clear-dns-cache
复制自: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=7904in Android because of the way it stores DNS cache. Clearing the browser cache doesn't touch the DNS, the "hard reset" clears it.
默认情况下,地址缓存 600 秒(10 分钟)。失败的查找会缓存 10 秒。从我所看到的一切来看,没有任何内置的东西可以刷新缓存。 由于它存储 DNS 缓存的方式,这显然是Android 中报告的错误http://code.google.com/p/android/issues/detail?id=7904。清除浏览器缓存不会触及 DNS,“硬重置”会将其清除。
回答by Chris
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.
执行手机的硬重启。最简单的方法是取出手机的电池。等待至少 30 秒,然后更换电池。手机将重新启动,并在完成重新启动后将拥有一个空的 DNS 缓存。
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
阅读更多:如何在 Android 手机上刷新 DNS | eHow.com http://www.ehow.com/how_10021288_flush-dns-android-phone.html#ixzz1gRJnmiJb