appleDNS — Speed Up Your Apple Store Updates

Apple’s App Store speeds in China have always been painfully slow. Today, while browsing forums, I stumbled upon an open-source project called AppleDNS that can speed up your Apple Store access.

After testing, while it won’t make things blazing fast, there’s definitely a noticeable improvement (now content displays within 2-3 seconds).

The principle is: the Python script batch-tests your local network latency to various Apple servers, then generates a hosts file with the fastest servers. You know the rest.

Ultimately, it still depends on your internet speed.

Tips: Configuration supports surge, hosts, and merlin formats.

Usage is extremely simple. GitHub project homepage: AppleDNS

Clone the code, run two scripts to get the configuration file, then manually apply the configuration.

The README is fairly clear.

Terminal window
# Navigate to the AppleDNS directory
cd /path/to/AppleDNS
# Test speed
# Python 2.7+ / Python 3.4+ compatible script
# (Choose the file corresponding to your ISP: ChinaUnicom, ChinaNet, CMCC)
# Confirm to start speed testing, wait a few seconds
python fetch-timeout.py ChinaUnicom/ChinaNet/CMCC.json
# Generate config, supports surge, hosts, merlin
# Generate various configuration formats (e.g., for Surge: python export-configure.py surge)
python export-configure.py {surge,hosts,merlin}

A note for macOS: after appending the generated hosts to /etc/hosts, you need to flush the local DNS cache.

Terminal window
# Cache flush commands vary by macOS version
# 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

Then open the App Store and enjoy!

Finally, here’s an official enterprise solution from Apple: Apple addresses this slow update issue for enterprise users by integrating a caching service in the OS X Server module. This means that if you have an OS X Server on your local network, both App Store and iOS App Store content will be cached according to configured rules.

References: https://support.apple.com/zh-cn/HT6018 http://help.apple.com/serverapp/mac/4.0/?lang=zh-cn#/apd74DDE89F-08D2-4E0A-A5CD-155E345EFB83

The above hasn’t been truly tested since I don’t have multiple Apple devices to test with — for reference only.