国内无法访问github
的问题除了用某工具访问,还可以通过hosts
文件来达到效果,
缺点就是需要经常更新ip
地址。
通过网址http://ip.tool.chinaz.com/来查询github.com
的真实ip
地址
host文件位置
Windows
系统:C:\Windows\System32\drivers\etc
Linux
系统:/etc/hosts
在hosts文件的最后添加如下信息:
${查询到的ip地址} ${目标网址}
Windows
用管理员身份运行如下命令:
cp ./hosts "C:\Windows\System32\drivers\etc\hosts"
Linux
运行如下命令:
sudo cp ./hosts /etc/hosts
Windows
用管理员身份运行如下命令:
ipconfig /flushdns
Linux
运行如下命令:
sudo systemctl restart NetworkManager
使用Edge浏览器
>>[...]
>>settings
>>搜索DNS
>>Use secure DNS to specify how to lookup the network address for websites[O]
>>Choose a service provider[O]
>>NextDNS[O]
>>Reboot Edge