1.WHAT
AppleDNS collections the DNS data in China, and it can be used to solve the problem accessing App Store / Mac App Store / iTunes Store / Apple Music slow.
2.HOW TO USE
(1)Clone repository into your local path everywhere you want.Mine is ~/dev/
git clone git@github.com:gongjianhui/AppleDNS.git
(2) into the AppleDNS root path, execute python command and wait several minutes.
cd ~/dev/AppleDNS
python fetch-timeout.py ChinaUnicom.json
(3) Generate content.There are three choices: surge,hosts,merlin. Here is hosts.
python export-configure.py hosts
(4) Copy the generated content into hosts file.
# Build Date: 2016-11-17T02:38:34.420896 (UTC)
# API-1-ChinaNetCenter [ChinaUnicom] (Avg RTT: 13.950ms)
112.90.240.7 se.itunes.apple.com
112.90.240.7 su.itunes.apple.com
112.90.240.7 upp.itunes.apple.com
112.90.240.7 play.itunes.apple.com
112.90.240.7 client-api.itunes.apple.com
# API-HK-Akamai-1 [HongKong0] (Avg RTT: 15.067ms)
23.50.17.214 search.itunes.apple.com
# API-HK-Akamai-2-AMRadio [HongKong1] (Avg RTT: 18.048ms)
184.87.100.246 radio.itunes.apple.com
184.87.100.246 radio-activity.itunes.apple.com
184.87.100.246 radio-services.itunes.apple.com
(5)you may be should clear DNS Cache.Notice: the command is not the same in different Mac OS versions.
# 10.10.4 or later:
sudo killall -HUP mDNSResponder
# 10.10 ~ 10.10.3:
sudo discoveryutil mdnsflushcache
# 10.7 ~ 10.9.5:
sudo killall -HUP mDNSResponder
# 10.6 ~ 10.6.8:
sudo dscacheutil -flushcache