explaingit

521xueweihan/github520

📈 Trending28,696PythonAudience · generalComplexity · 1/5ActiveSetup · easy

TLDR

Speed up GitHub access by adding direct IP-to-hostname mappings to your computer's hosts file, bypassing slow DNS lookups.

Mindmap

mindmap
  root((repo))
    What it does
      Speeds up GitHub
      Bypasses DNS delays
      Maps IPs to domains
    How to use
      Edit hosts file
      Use SwitchHosts tool
      Shell commands
    Setup methods
      Manual copy-paste
      Auto-update hourly
      AdGuard integration
    Who needs it
      Slow GitHub regions
      Unreliable connections
      No install required
    Tech approach
      Python verification
      IP discovery
      Regular updates

Things people build with this

USE CASE 1

Speed up GitHub page loads and image display in regions with slow or unreliable DNS.

USE CASE 2

Automate hourly updates of IP mappings using SwitchHosts without manual intervention.

USE CASE 3

Subscribe to the mappings URL in AdGuard to filter DNS requests for faster GitHub access.

USE CASE 4

Apply a one-time hosts file update via shell command on Linux or macOS servers.

Tech stack

PythonHosts fileSwitchHostsAdGuardShell scripting

Getting it running

Difficulty · easy Time to first run · 5min
License could not be detected automatically. Check the repository's LICENSE file before use.

In plain English

GitHub520 is a project that speeds up access to GitHub by modifying your computer's "hosts" file, a local text file that maps website names to IP addresses. When GitHub loads slowly or images in GitHub projects fail to display, it is often because DNS resolution (the process of converting a website name like github.com into a numeric address) is taking a roundabout or blocked path. By adding a curated list of direct IP address mappings to your hosts file, this project bypasses the slow DNS lookup and connects you straight to GitHub's servers. The README is written primarily in Chinese and is aimed at users in regions where GitHub access is slow or unreliable. No software installation is needed, you copy a block of pre-tested IP-to-hostname mappings into your hosts file, which takes about five minutes. The project provides a URL that serves an always-updated version of these mappings, so you can refresh them regularly. For those who prefer automation, the README shows how to use a tool called SwitchHosts to subscribe to the mappings URL and auto-update hourly, as well as single-line shell commands for Linux and macOS to fetch and apply updates via a scheduled job. AdGuard (a DNS filtering app) users can also subscribe to the same URL as a custom DNS blocklist. The project is maintained using Python to find and verify the best IP addresses for each GitHub domain. It is relevant for anyone who finds GitHub slow to load and wants a no-cost, no-software fix.

Copy-paste prompts

Prompt 1
How do I add the GitHub520 IP mappings to my hosts file on Windows/Mac/Linux?
Prompt 2
Show me how to set up SwitchHosts to auto-update GitHub IP addresses every hour.
Prompt 3
What's the shell command to fetch and apply GitHub520 mappings on my Linux server?
Prompt 4
Can I use GitHub520 with AdGuard, and if so how do I subscribe to the URL?
Prompt 5
Why is GitHub slow in my region, and will GitHub520 actually fix it?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.