【hosts】windows/mac上修改hosts

windows上hosts的位置


C:\Windows\System32\drivers\etc\hosts



mac上hosts的为位置

打开terminal

输入cd /etc按回车

输入cat hosts按回车

输入vim hosts按回车

(之后的操作为vim操作)



hosts文件中格式(前面为本地的ip地址,后面为需要配置的域名)

127.0.0.1    localhost

127.0.0.1    www.testdomain.com



修改完hosts之后,需要重新打开浏览器



posted @ 2017-04-21 11:29  snow_finland  阅读(152)  评论(0编辑  收藏  举报