GitHub Hosts CN
Fix GitHub timeout and rate limits on China servers.
Security
- Appends to
/etc/hostsonly (never overwrites existing) - Auto-backs up hosts before each update
- One-click rollback:
python3 scripts/rollback.py - No packages, no daemons, no system changes
One-Line Run
sudo python3 scripts/update_hosts.py
How It Works
- Test GitHub CDN speed
- If slow/unreachable, find new IP via DNS
- Append optimized entry to
/etc/hosts - Auto-commit to git + optional ClawHub publish
Manual Commands
# Force update
sudo python3 scripts/update_hosts.py --force
# Rollback to last backup
sudo python3 scripts/rollback.py
# Check current hosts entries
grep github /etc/hosts
