当前位置:   article > 正文

西北地区无法使用Github怎么办?_github 地址阻焊换

github 地址阻焊换

GitHub在国内访问速度慢的问题原因有很多,但最直接和最主要的原因是GitHub的分发加速网络的域名遭到dns污染。

通过修改系统hosts文件的办法,绕过国内dns解析,直接访问GitHub的CDN节点,从而达到github访问加速的目的。

一、获取GitHub官方CDN地址

打开页面 https://www.ipaddress.com/

查询以下DNS解析地址:

  • github.com
  • github.global.ssl.fastly.net
  • api.github.com

不显示头像等问题,还需查询以下IP地址:

  • avatars0.githubusercontent.com
  • avatars1.githubusercontent.com
  • avatars2.githubusercontent.com
  • avatars3.githubusercontent.com

二、修改系统Hosts文件

打开 C:\Windows\System32\drivers\etc 路径下的host文件(需要管理员权限)

文件末尾追加内容(IP地址与域名间需留有空格):

  1. # Copyright (c) 1993-2009 Microsoft Corp.
  2. #
  3. # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
  4. #
  5. # This file contains the mappings of IP addresses to host names. Each
  6. # entry should be kept on an individual line. The IP address should
  7. # be placed in the first column followed by the corresponding host name.
  8. # The IP address and the host name should be separated by at least one
  9. # space.
  10. #
  11. # Additionally, comments (such as these) may be inserted on individual
  12. # lines or following the machine name denoted by a '#' symbol.
  13. #
  14. # For example:
  15. #
  16. # 102.54.94.97 rhino.acme.com # source server
  17. # 38.25.63.10 x.acme.com # x client host
  18. #
  19. # localhost name resolution is handled within DNS itself.
  20. # 127.0.0.1 localhost
  21. # ::1 localhost
  22. #github
  23. 140.82.114.3 github.com #
  24. 199.232.69.194 github.global.ssl.fastly.net #
  25. 140.82.112.6 api.github.com #
  26. 199.232.96.133 avatars0.githubusercontent.com #
  27. 199.232.96.133 avatars1.githubusercontent.com #
  28. 199.232.96.133 avatars2.githubusercontent.com #
  29. 199.232.96.133 avatars3.githubusercontent.com #

三、刷新系统DNS缓存

打开 command命令行(以管理员身份) 或 powershell

运行 ipconfig /flushdns 手动刷新系统DNS缓存。

 

至此已经能够正常使用github,尽情的star吧!!

 

参考

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/713414
推荐阅读
相关标签
  

闽ICP备14008679号