开发通常需要从国外网站下载一些工具和插件,例如 IDEA的插件,Github。
因国内访问国外网络各种不可描述问题,通常会非常慢,只要不是被 Great FireWall 给禁了,可以在 host 设置域名映射的IP来加快速度,而不必经过国内各种路由解析转发各种限速。
查看域名映射的IP
国外域名打开网站查询:https://www.ipaddress.com/
编辑 hosts 文件
编辑 hosts 文件,添加域名与IP地址的映射
- Windows:C:\Windows\System32\drivers\etc\hosts
- Linux:/etc/host
示例:
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
刷新本地DNS缓存
Windows
# 显示dns缓存
ipconfig /displaydns
# 刷新DNS记录
ipconfig /flushdns
# 重请从DHCP服务器获得IP
ipconfig /renew
Linux
重启网络
sudo /etc/init.d/networking restart
或安装 nscd
# Ubuntu:
apt-get install -y nscd
# CentOS:
yum install -y nscd
# 使用:
service nscd restart
示例
# typora.io
104.24.156.12 typora.io
104.24.157.12 typora.io
172.67.97.82 typora.io
# github
140.82.114.3 github.com
140.82.114.9 codeload.github.com
192.30.253.119 gist.github.com
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
151.101.100.133 gist.githubusercontent.com
151.101.100.133 cloud.githubusercontent.com
151.101.100.133 camo.githubusercontent.com
151.101.100.133 avatars0.githubusercontent.com
151.101.100.133 avatars1.githubusercontent.com
151.101.100.133 avatars2.githubusercontent.com
151.101.100.133 avatars3.githubusercontent.com
151.101.100.133 avatars4.githubusercontent.com
151.101.100.133 avatars5.githubusercontent.com
151.101.100.133 avatars6.githubusercontent.com
151.101.100.133 avatars7.githubusercontent.com
151.101.100.133 avatars8.githubusercontent.com
23.111.9.35 fontawesome.com
52.85.224.40 plugins.jetbrains.com
更多内容请访问:IT源点
注意:本文归作者所有,未经作者允许,不得转载