Using SwitchHosts to Speed Up Access to Github

Published on Aug. 22, 2023, 12:20 p.m.

Github’s website often encounters issues with accessibility. We can use SwitchHosts to automatically modify the hosts file to ensure smooth access (although there is still a chance of failure).

Windows

The hosts file is located at C:/windows/system32/drivers/etc/hosts. We can update the hosts file and then refresh the DNS cache using the command:

ipconfig /flushdns

To use SwitchHosts and remotely update hosts:

SwitchHosts website: https://swh.app/zh/

After downloading and installing, add the remote rule as follows:

Host type: Remote
Host title: github-hosts (can be customized)
Automatic refresh: every hour
URLs:
https://gitee.com/isevenluo/github-hosts/raw/master/hosts
I tested three URLs, but there were still intermittent successes and failures.

URL1: https://cdn.jsdelivr.net/gh/521xueweihan/GitHub520@main/hosts
URL2: https://raw.hellogithub.com/hosts
URL3: https://gitee.com/isevenluo/github-hosts/raw/master/hosts