国内无法访问GitHub官网的问题解决

作为一名程序员,在国内访问GitHub官网经常会遇到打开过慢或者访问失败的问题,但通过一些技巧可以改善访问体验。GitHub访问问题的根源在于GitHub官网访问不稳定的主要原因在于DNS解析过程。当我们直接访问github.com时,需要通过DNS服务器将域名转换为对应的IP地址。由于某些原因,这个解析过程在国内可能会变得缓慢或不稳定,导致有时能打开,有时无法访问,或者加载速度极慢。本文通过介绍修改Hosts文件解决GitHub访问过慢或者打不开的为标题
在这里插入图片描述
1.打开dns查询 - bejson在线工具,输入“https://github.com” 解析域名
在这里插入图片描述
2.修改C:\Windows\System32\drivers\etc下的hosts文件
在这里插入图片描述
3.启动命令运行窗口,运行命令:ipconfig/flushdns ,刷新DNS缓存。
在这里插入图片描述
4.验证配置是否生效,命令运行窗口,运行命令:ping github.com,如下图说明配置成功
在这里插入图片描述
5.浏览器访问https://github.com/可以正常访问,如无法访问可以重启电脑试试
在这里插入图片描述
6.下面是git相关的域名和DNS解析,也可访问https://raw.hellogithub.com/hosts直接下载

# GitHub520 Host Start
140.82.112.25                 alive.github.com
20.205.243.168                api.github.com
140.82.114.21                 api.individual.githubcopilot.com
185.199.110.133               avatars.githubusercontent.com
185.199.110.133               avatars0.githubusercontent.com
185.199.110.133               avatars1.githubusercontent.com
185.199.110.133               avatars2.githubusercontent.com
185.199.110.133               avatars3.githubusercontent.com
185.199.110.133               avatars4.githubusercontent.com
185.199.110.133               avatars5.githubusercontent.com
185.199.110.133               camo.githubusercontent.com
140.82.114.21                 central.github.com
185.199.110.133               cloud.githubusercontent.com
20.205.243.165                codeload.github.com
140.82.114.22                 collector.github.com
185.199.110.133               desktop.githubusercontent.com
185.199.110.133               favicons.githubusercontent.com
20.205.243.166                gist.github.com
54.231.160.73                 github-cloud.s3.amazonaws.com
16.182.107.177                github-com.s3.amazonaws.com
16.182.33.73                  github-production-release-asset-2e65be.s3.amazonaws.com
3.5.28.170                    github-production-repository-file-5c1aeb.s3.amazonaws.com
54.231.197.177                github-production-user-asset-6210df.s3.amazonaws.com
192.0.66.2                    github.blog
20.205.243.166                github.com
140.82.112.18                 github.community
185.199.108.154               github.githubassets.com
151.101.193.194               github.global.ssl.fastly.net
185.199.108.153               github.io
185.199.110.133               github.map.fastly.net
185.199.108.153               githubstatus.com
140.82.113.25                 live.github.com
185.199.110.133               media.githubusercontent.com
185.199.110.133               objects.githubusercontent.com
13.107.42.16                  pipelines.actions.githubusercontent.com
185.199.110.133               raw.githubusercontent.com
185.199.110.133               user-images.githubusercontent.com
13.107.246.73                 vscode.dev
140.82.113.22                 education.github.com
185.199.110.133               private-user-images.githubusercontent.com


# Update time: 2025-04-29T12:07:30+08:00
# Update url: https://raw.hellogithub.com/hosts
# Star me: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

局外人LZ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值