赞
踩
GitHub在国内访问速度慢的问题原因有很多,但最直接和最主要的原因是GitHub的分发加速网络的域名遭到dns污染。
通过修改系统hosts文件的办法,绕过国内dns解析,直接访问GitHub的CDN节点,从而达到github访问加速的目的。
打开页面 https://www.ipaddress.com/
查询以下DNS解析地址:
不显示头像等问题,还需查询以下IP地址:
打开 C:\Windows\System32\drivers\etc 路径下的host文件(需要管理员权限)
文件末尾追加内容(IP地址与域名间需留有空格):
- # Copyright (c) 1993-2009 Microsoft Corp.
- #
- # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
- #
- # This file contains the mappings of IP addresses to host names. Each
- # entry should be kept on an individual line. The IP address should
- # be placed in the first column followed by the corresponding host name.
- # The IP address and the host name should be separated by at least one
- # space.
- #
- # Additionally, comments (such as these) may be inserted on individual
- # lines or following the machine name denoted by a '#' symbol.
- #
- # For example:
- #
- # 102.54.94.97 rhino.acme.com # source server
- # 38.25.63.10 x.acme.com # x client host
- #
- # localhost name resolution is handled within DNS itself.
- # 127.0.0.1 localhost
- # ::1 localhost
-
-
- #github
- 140.82.114.3 github.com #
- 199.232.69.194 github.global.ssl.fastly.net #
- 140.82.112.6 api.github.com #
- 199.232.96.133 avatars0.githubusercontent.com #
- 199.232.96.133 avatars1.githubusercontent.com #
- 199.232.96.133 avatars2.githubusercontent.com #
- 199.232.96.133 avatars3.githubusercontent.com #
打开 command命令行(以管理员身份) 或 powershell
运行 ipconfig /flushdns 手动刷新系统DNS缓存。
至此已经能够正常使用github,尽情的star吧!!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。