一、修改hosts
1、解决在 Win10没有修改 hosts文件权限问题
WIN + R
打开下方框框,输入“C:\Windows\System32\drivers\etc
”:
根据下图3步操作,以管理员身份运行:
在弹出终端窗口中依次输入cmd
、notepad hosts
:
然后就可以任意修改hosts啦
2、在Ubuntu18.04虚拟机中修改hosts
打开终端命令行,输入命令:sudo gedit /etc/hosts
,即可打开并编辑hosts文件。
二、修改hosts内容
在打开的hosts
文件中添加下面这段“github520代码”(实现自动更新ip):
# GitHub520 Host Start
140.82.113.26 alive.github.com
140.82.113.26 live.github.com
185.199.108.154 github.githubassets.com
140.82.113.21 central.github.com
185.199.108.133 desktop.githubusercontent.com
185.199.108.153 assets-cdn.github.com
185.199.108.133 camo.githubusercontent.com
185.199.108.133 github.map.fastly.net
199.232.69.194 github.global.ssl.fastly.net
140.82.114.3 gist.github.com
185.199.108.153 github.io
140.82.112.4 github.com
192.0.66.2 github.blog
140.82.112.5 api.github.com
185.199.108.133 raw.githubusercontent.com
185.199.108.133 user-images.githubusercontent.com
185.199.108.133 favicons.githubusercontent.com
185.199.108.133 avatars5.githubusercontent.com
185.199.108.133 avatars4.githubusercontent.com
185.199.108.133 avatars3.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
185.199.108.133 avatars1.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.108.133 avatars.githubusercontent.com
140.82.114.10 codeload.github.com
52.216.143.84 github-cloud.s3.amazonaws.com
54.231.140.153 github-com.s3.amazonaws.com
52.217.64.52 github-production-release-asset-2e65be.s3.amazonaws.com
52.217.163.105 github-production-user-asset-6210df.s3.amazonaws.com
52.216.176.139 github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153 githubstatus.com
64.71.144.202 github.community
23.100.27.125 github.dev
140.82.112.22 collector.github.com
13.107.42.16 pipelines.actions.githubusercontent.com
185.199.108.133 media.githubusercontent.com
185.199.108.133 cloud.githubusercontent.com
185.199.108.133 objects.githubusercontent.com
三、每次使用前刷新一下DNS
Windows每天使用前都要刷新一下DNS,否则依旧会很慢
(Ubuntu暂时还不清楚)
Windows+X 打开系统命令行(管理员身份)
或powershell
,
运行ipconfig /flushdns
手动刷新系统DNS缓存。
文章来源:https://www.toymoban.com/news/detail-597695.html
可爱的界面出来啦
文章来源地址https://www.toymoban.com/news/detail-597695.html
到了这里,关于实现Github的正常使用的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!