Github ソリューションにアクセスできません

ローカルホストファイルの内容を変更することで、github に正常にアクセスできるようになります。

操作は非常に簡単で、hostsファイルを変更するだけです。

1.hostsファイルを見つけます

hosts ファイルの場所はシステムごとに異なり、詳細は次のとおりです:
Windows システム: C:\Windows\System32\drivers\etc\hosts
Linux システム: /etc/hosts
Mac (Apple Computer) システム: /etc/ホスト
Android (Android) ) システム: /system/etc/hosts
iPhone (iOS) システム: /etc/hosts

2.ホストファイルを開きます

Windowsではメモ帳を使用します。
Linux と Mac は Root 権限を使用します: sudo vi /etc/hosts
iPhone と iPad はジェイルブレイクする必要があり、Android は root である必要があります

3. 次のコードの内容をデバイスの hosts ファイルの末尾にコピーします。

# GitHub520 Host Start
185.199.108.154               github.githubassets.com
140.82.113.22                 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.113.3                  gist.github.com
185.199.108.153               github.io
140.82.114.4                  github.com
140.82.112.6                  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.113.9                  codeload.github.com
52.217.88.28                  github-cloud.s3.amazonaws.com
52.216.238.99                 github-com.s3.amazonaws.com
52.216.26.252                 github-production-release-asset-2e65be.s3.amazonaws.com
52.217.101.68                 github-production-user-asset-6210df.s3.amazonaws.com
52.217.48.84                  github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153               githubstatus.com
64.71.168.201                 github.community
185.199.108.133               media.githubusercontent.com

# Update time: 2022-11-01T12:00:00+08:00
# Star me GitHub url: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End

上記コンテンツは定期的に自動更新されますので、更新時間を気にする必要はありません。

4. hosts ファイルをアクティブ化して有効にします。

ほとんどの場合、これは直接有効になりますが、有効にならない場合は、次の方法を試して DNS を更新してください。

Windows: CMD ウィンドウに「ipconfig /flushdns」と入力します。

Linux コマンド: sudo rcnscd restart

Mac 命令:sudo killall -HUP mDNSResponder

ヒント: 上記の方法が無効な場合は、マシンを再起動してみてください。

おすすめ

転載: blog.csdn.net/weixin_46398647/article/details/127635175