在apple app store中下载,速度有时快有时慢,因为苹果的2000台服务器分布在全球各地。
通过修改hosts,可以指定为速度快的IP,比如香港澳门的服务器。
获得速度快的IP的方法:
在ping.chinaz.com查询域名的ping值,选几个在自己的网络中测试速度。
在PC Windows、Linux上修改hosts很容易,在获得root权限的Android上也可以,在iPhone、iPad上无法修改。
适用场景:
1、无法修改hosts:没有root的Android,iOS等
2、多人修改hosts比较繁琐,一旦IP失效,大家都要改:比如创业的Android、iOS开发组。
目的:
提高Apple app store下载速度,提高Google Play下载速度。
解决方案:
在路由器上配DNSMasq——就是把hosts改改格式,写到路由器上即可。
DNSMasq支持泛域名,比如在hosts中需要配2000条:
# apple app store 202.175.5.114 a1.phobos.apple.com 202.175.5.114 a2.phobos.apple.com 202.175.5.114 a3.phobos.apple.com …… 202.175.5.114 a2000.phobos.apple.com
而DNSMasq只需要1条:
#apple app store address=/.phobos.apple.com/202.175.5.114
软硬件要求:
由于家用路由器的系统一般不支持修改DNSMasq,所以要给路由器安装dd-wrt、openwrt等开源OS。
购买有线或无线路由器时请按照dd-wrt、openwrt的设备支持列表购买。
dd-wrt支持列表:http://www.dd-wrt.com/wiki/index.php/Supported_Devices
openwrt支持列表:http://wiki.openwrt.org/toh/start
操作步骤:
1、买路由器
2、到dd-wrt.com下载OS固件,在路由器管理界面192.168.1.1中刷入OS
3、在新的dd-wrt OS管理界面192.168.1.1——〉服务——〉服务——〉“DNSMasq 附加选项”中填入下列内容——〉应用
常用服务的DNSMasq:
#Android -> Account & sync -> Add account -> Google ##good, 114DNS server=/android.clients.google.com/114.114.114.114 ##bad, because google CN IP no ssl #address=/android.clients.google.com/203.208.45.211 ##good, google USA IP #address=/android.clients.google.com/74.125.31.100 #Android -> Gtalk ##good, 114DNS server=/mtalk.google.com/114.114.114.114 ##bad, google CN #address=/mtalk.google.com/203.208.45.211 ##good, google USA IP #address=/mtalk.google.com/74.125.71.188 #Android -> Google Play -> install address=/.c.android.clients.google.com/203.208.45.211 #google photo #Android -> Google Play -> app logo and screenshot #Web -> Google Play address=/.ggpht.com/203.208.45.211 #google user content #Android -> Google+ -> user avatar and feed img #Web -> Google+ address=/.googleusercontent.com/203.208.45.211 #google cn #Web -> Google ditu address=/.google.cn/203.208.45.211 address=/google.cn/203.208.45.211 address=/g.cn/203.208.45.211 #google static #Web -> google images search address=/.gstatic.com/203.208.45.211 #Web https -> google images search address=/encrypted-tbn1.google.com/203.208.45.211 #Web ->Google Play address=/play.google.com/203.208.45.211 address=/apis.google.com/203.208.45.211 #Web ->Gmail address=/clients2.google.com/203.208.45.211 #Web address=/google.com/203.208.45.211 address=/www.google.com/203.208.45.211 address=/www.google.com.hk/203.208.45.211 address=/accounts.google.com/203.208.45.211 address=/mail.google.com/203.208.45.211 address=/code.google.com/203.208.45.211 address=/translate.google.com/203.208.45.211 address=/translate.google.com.hk/203.208.45.211 address=/docs.google.com/203.208.45.211 address=/profiles.google.com/203.208.45.211 address=/plus.google.com/203.208.45.211 address=/picasaweb.google.com/203.208.45.211 address=/news.google.com/203.208.45.211 address=/ditu.google.com/203.208.45.211 #apple app store address=/.phobos.apple.com/202.175.5.114
参考资料:
http://code.google.com/p/dnsmasq-android-ios/
http://code.google.com/p/smarthosts/
todo:
Android Google+的接口uri未知,所以经常断线。web版是plus.google.com很容易知道。
截图:
via。http://www.cnblogs.com/sink_cup/archive/2012/08/17/router_dnsmasq_android_hosts.html