一、Windows
host文件位置:C:\Windows\System32\drivers\etc\hosts
在属性里面修改文件的权限——增加修改权限
在文件中加入需要的内容:【ip地址 服务器地址】
ipconfig /flushdns //刷新DNS
二、Ubuntu
sudo vim /etc/hosts
(按i插入信息,:wq保存并退出!)
重启网络:
/etc/init.d/networking restart
附:一些ip查询网站
https://site.ip138.com/s3.eu-central-1.amazonaws.com/
http://ip.tool.chinaz.com/
https://githubusercontent.com.ipaddress.com/