在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很容易知道。
截圖:






