电脑无法访问github怎么解决
作为一名程序员,平时访问最多的网站就是github了。上面还很多免费开源的资料和工具供我们学习使用,电脑无法打开github网站,这是我们不能接受的。现在我们来根据下面方法来试试吧。 一道面试题讲起 问题:在浏览器输入网址后回车,背后发生了什么 域名解析:将域名解析成Ip地址。 github之所以打不开? ●一方面是服务器部署在国外,访问慢。 ●域名解析慢 修改hosts文件 方法一:switchhost 官网:https://switchhosts.vercel.app/zh 这里你可以访问官网下载,但这个网址不太好打开。 百度网盘资源: 通过网盘分享的文件:SwitchHost修改本地host文件工具 链接: https://pan.baidu.com/s/1jW2TKIaLNjU34OEf77zZZA?pwd=5mnm 提取码: 5mnm ●Hosts 类型: 远程(Remote) ●Hosts 标题: 自命名即可, 如 GitHub520 ●URL: https://raw.hellogithub.com/hosts ●自动刷新: 推荐是 1 小时 switchhost报错,没有写入权限怎么解决 以管理员方式运行switchhost 1、打开本机 hosts文件 2、鼠标右键hosts文件,属性--》去掉只读 勾选 3、点击安全,点击编辑,找到user自己的用户名,勾选完全控制 然后就可以修改了。 这里有一点非常重要,需要刷新本地的dns ipconfig /flushdns 方法二:直接修改hosts文件 # GitHub520 Host Start 140.82.114.26 alive.github.com 20.205.243.168 api.github.com 140.82.114.21 api.individual.githubcopilot.com 185.199.111.133 avatars.githubusercontent.com 185.199.111.133 avatars0.githubusercontent.com 185.199.111.133 avatars1.githubusercontent.com 185.199.111.133 avatars2.githubusercontent.com 185.199.111.133 avatars3.githubusercontent.com 185.199.111.133 avatars4.githubusercontent.com 185.199.111.133 avatars5.githubusercontent.com 185.199.111.133 camo.githubusercontent.com 140.82.112.21 central.github.com 185.199.111.133 cloud.githubusercontent.com 20.205.243.165 codeload.github.com 140.82.113.21 collector.github.com 185.199.111.133 desktop.githubusercontent.com 185.199.111.133 favicons.githubusercontent.com 20.205.243.166 gist.github.com 3.5.21.107 github-cloud.s3.amazonaws.com 16.15.193.61 github-com.s3.amazonaws.com 52.216.76.212 github-production-release-asset-2e65be.s3.amazonaws.com 3.5.13.179 github-production-repository-file-5c1aeb.s3.amazonaws.com 52.217.42.156 github-production-user-asset-6210df.s3.amazonaws.com 192.0.66.2 github.blog 20.205.243.166 github.com 140.82.112.17 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.111.133 github.map.fastly.net 185.199.108.153 githubstatus.com 140.82.112.26 live.github.com 185.199.111.133 media.githubusercontent.com 185.199.111.133 objects.githubusercontent.com 13.107.42.16 pipelines.actions.githubusercontent.com 185.199.111.133 raw.githubusercontent.com 185.199.111.133 user-images.githubusercontent.com 13.107.213.73 vscode.dev # Timeout 140.82.113.21 education.github.com 185.199.111.133 private-user-images.githubusercontent.com # Update time: 2026-03-19T19:53:09+08:00 # Update url: https://raw.hellogithub.com/hosts # Star me: https://github.com/521xueweihan/GitHub520 # GitHub520 Host End 方法三:使用加速链接 https://keli.blog/ 直接将github抵制粘贴到里面,生成代理链接