Skip to content

Changing GitHub Host


Error: curl: (7) Failed to connect to port 443: Connection refused


DNS contamination in China.


Add the following entries to your local host file:

Host file paths:

  • Windows: C:\Windows\System32\drivers\etc
  • Linux: /etc/hosts

Here are steps for Linux:

  1. Open a terminal.
  2. Enter the command: vi /etc/hosts
  3. Press A to switch to edit mode.
  4. Add the above host directives at the end.
  5. Press Esc to exit edit mode, then type :wq to save and exit.


To find the IP of a domain, you can use IPAddress.

References and Acknowledgments

Article by: Power Lin Original Source: Copyright Notice: This article is licensed under CC BY-NC-SA 4.0. Please provide attribution when reposting.

This post is translated using ChatGPT, please feedback if any omissions.