How to save you, my GitHub — how to visit China at the speed of light

Time:2020-11-25

Follow me to unlock all my posts. Welcome to like, leave a message to communicate with me


When it comes to the world’s largest programmer website, you must know what I’m talking about….

How to save you, my GitHub -- how to visit China at the speed of light

Yes, it’s GitHub, the world’s largest open source community.

Daily code, we most often use it. However, in recent years, the network blockade is too severe, and some areas in China have been so serious that they can’t be accessed by unscientific Internet access. How can this stop me from being a positive and good learner.

The author has also experienced such pain: it takes half a minute or a minute to open GitHub’s homepage, and it takes luck to get down a project of clone. If you are not lucky, you may kneel down halfway. It’s really painful.

But now the solution is here!

I (get) t (kick) circle of friends should know, when we enter on the website github.com When he first requests the DNS server to resolve the address, that is to say github.com Convert it to an IP address and return it to us for us to visit. However, by default, this IP address may not be the optimal solution. In serious cases, the Ping value reaches thousands of milliseconds, and it is still playing a P… In this case, we need to switch to manual mode.

So the problem is, how to switch to manual operation? Can’t you pick your own feet? That’s stupid

Here is an artifact for Amway: switchhost! You can pay attention to my official account: DNS will be sent back to you.

How to save you, my GitHub -- how to visit China at the speed of light

It is an app written based on python, which can help us manually change the default returned IP to achieve the purpose of accelerating access, and can run across platforms.

Then the question comes again. Where can I find the fastest IP address?

Here to recommend a magical website: webmaster tool DNS detection

Well, with these two artifacts, we can start to do things

First, open the DNS detection website:

How to save you, my GitHub -- how to visit China at the speed of light

Then, check each of the following addresses with this website:

gist.github.com
assets-cdn.github.com
raw.githubusercontent.com
gist.githubusercontent.com
cloud.githubusercontent.com
camo.githubusercontent.com
avatars0.githubusercontent.com
avatars1.githubusercontent.com
avatars2.githubusercontent.com
avatars3.githubusercontent.com
avatars4.githubusercontent.com
avatars5.githubusercontent.com
avatars6.githubusercontent.com
avatars7.githubusercontent.com
avatars8.githubusercontent.com
www.github.com

Find the one with the minimum TTL value for rule matching. The rule matching method is as follows: for example:
How to save you, my GitHub -- how to visit China at the speed of light

We can see that after DNS detection, the TTL (time to live) value of this address in Hunan is the smallest.

Next, we’ll open swithhost and click the plus sign in the lower left corner

How to save you, my GitHub -- how to visit China at the speed of light

This dialog box will appear:

How to save you, my GitHub -- how to visit China at the speed of light

Enter a name you like, name it as rule, click OK, and then write the address in this format:

As you can see, I not only added the address of GitHub, but also added stack overflow, so that I can drive freely on the network… Oh, No… Happy.

However, there is one thing to say here. If it is blocked by domestic GW, it is useless to add DNS.

After adding DNS, remember to turn on the DNS rule switch:

Well, when we reopen the browser, the browser will access according to our configured rules. How about it? Does it feel much faster?

Say the point!
Give some benefits to my friends who see here and pay attention to me.

When you are developing in the company, do you often switch online, offline, or test environments? We need to modify the code to achieve the conventional method. But with switchhost, it will be much easier. We can configure the rules of each environment separately, which environment is needed, and activate it. From then on, we can switch the environment so easy!


Finally, we would like to invite you to pay attention to the following official account, the most powerful and dry cargo in the history of the Internet.
How to save you, my GitHub -- how to visit China at the speed of light