android clear dns bug处理

来源:互联网 发布:淘宝搜图片找产品 编辑:程序博客网 时间:2024/05/22 10:31

问题:服务器IP改变以后,android dns cache 由于没有被清除,导致域名解析出错。

http://stackoverflow.com/questions/2101762/android-flush-dns

同时 android dns cache 缓存清除没有提供上层接口,但是android 系统层却提供了这种功能,因此需要导出api 给上层程序使用。

查看ndc interface list

interfacelistreadrxcounter| readtxcountergetthrottle<iface><”rx|tx”>setthrottle<iface><rx_kbps|tx_kbps>driver<iface><cmd><args>route<add|remove> <iface> <”default|secondary”><dst> <prefix> <gateway>list_ttys ipfwdstatusenable|disabletetherstatusstart-reverse|stop-reversestop<start<addr_1 addr_2 addr_3 addr_4 [addr_2n]>interface<add|remove|list>dnslistdnsset <addr_1> < addr_2>nat<enable|disable><iface><extface><addrcnt><nated-ipaddr/prelength>pppdattach<tty> <addr_local> <add_remote> <dns_1><dns_2>detach<tty>softapstartap|stopapfwreload<iface> <AP|P2P>clientsstatusset<iface> <SSID> <wpa-psk|wpa2-psk|open> [<key><channel> <preamble><max SCB>]resolversetdefaultif<iface>setifdns<iface><dns_1><dns_2>flushdefaultifflushif<iface>bandwithenable|disableremovequota|rqgetquota|gqgetiquota|giq<iface>setquota|sq<bytes> <iface>removequota|rqs<iface>removeiiquota|riq<iface>setiquota|sq<interface><bytes>addnaughtyapps|ana<appUid>removenaughtyapps|rna<appUid>setgolbalalert|sga<bytes>debugsettetherglobalalert|dstga<iface0><iface1>setsharedalert|ssa<bytes>removesharedalert|rsasetinterfacealert|sia<iface><bytes>removeinterfacealert|ria<iface>gettetherstats|gts<iface0><iface1>idletimerenable|disableadd|remove<iface><timeout><classLabel>firewallenable|disable|is_enabledset_interface_rule<rmnet0><allow|deny>set_egress_source_rule<ip_addr><allow|deny>set_egress_dest_rule<ip_addr><port><allow|deny>set_uid_rule<uid><allow|deny>clatdstop|status|start<iface>


在实际代码调试时,可用flushdefaultif 命令清除DNS,实际代码中可以通过分析flushdefualtif命令流程,新增api接口供上层使用。

0 0
原创粉丝点击