文章目录
Windows
- 站长工具 DNS查询 查询域名 github.com 可响应的IP
- C:windowssystem32driversetchosts 添加一个配置
140.82.112.4 github.com # github
- 刷新 DNS 配置
ipconfig /flushdns
# 显示 DNS 缓存内容
ipconfig /displaydns
ping github.com
# 仅当前项目, 或者 --global 全局设置代理
# 开 vpn 后配置代理,端口为vpn 的端口
git config --add http.proxy http://127.0.0.1:7890
git config --add http.proxys http://127.0.0.1:7890
# 查看配置
git config --get http.proxy
# 取消代理
git config --unset http.proxy
# .git/config
...
[http]
proxy = http://127.0.0.1:7890
Linux
# /etc/hosts
# systemctl restart nscd