GitHub - 电脑无法访问GitHub

windows:

Windows电脑有时打不开GitHub,修改host文件即可

https://www.jianshu.com/p/3eacebfc55ab
https://www.cnblogs.com/Java-Script/p/11090777.html

host文件修改方法:

找到host文件路径:

C:\WINDOWS\System32\drivers\etc

在最后添加host

#github
192.30.253.112 github.com
151.101.113.194 github.global.SSL.fastly.net

dns刷新,打开cmd:

ipconfig /flushdns

注:
192.30.253.112是查找的github的网址
151.101.113.194是查找github.global.ssl.fastly.net网址

另外一种方式

1.打开Dns检测|Dns查询 - 站长工具
2.在检测输入栏中输入http://github.com官网
3.把检测列表里的TTL值最小的IP输入到hosts里,并对应写上github官网域名

https://github.com.ipaddress.com

Mac :

host路径

/private/etc

添加网址到 host

# GitHub Start 

192.30.253.112 Build software better, together 
192.30.253.119 gist.github.com
151.101.184.133 assets-cdn.github.com
151.101.184.133 raw.githubusercontent.com
151.101.184.133 gist.githubusercontent.com
151.101.184.133 cloud.githubusercontent.com
151.101.184.133 camo.githubusercontent.com
151.101.184.133 avatars0.githubusercontent.com
151.101.184.133 avatars1.githubusercontent.com
151.101.184.133 avatars2.githubusercontent.com
151.101.184.133 avatars3.githubusercontent.com
151.101.184.133 avatars4.githubusercontent.com
151.101.184.133 avatars5.githubusercontent.com
151.101.184.133 avatars6.githubusercontent.com
151.101.184.133 avatars7.githubusercontent.com
151.101.184.133 avatars8.githubusercontent.com
199.232.96.133 user-images.githubusercontent.com

# GitHub End

你可能感兴趣的:(GitHub - 电脑无法访问GitHub)