windows上hosts的位置vim
C:\Windows\System32\drivers\etc\hostswindows
mac上hosts的爲位置瀏覽器
打開terminaldom
輸入cd /etc按回車ip
輸入cat hosts按回車terminal
輸入vim hosts按回車域名
(以後的操做爲vim操做)
test
hosts文件中格式(前面爲本地的ip地址,後面爲須要配置的域名)
配置
127.0.0.1 localhostim
127.0.0.1 www.testdomain.com
修改完hosts以後,須要從新打開瀏覽器