如何修改hosts文件并生效(mac、window)

hosts文件位置C:\Windows\System32\drivers\etc(可以建立一个.bat 的文件把(start "" C:\Windows\System32\drivers\etc)放进去,可以点击打开文件)如

1.权限(只读和安全):邮件hosts文件

2.修改样式(前后映射)
3.生效(ipconfig /flushdns)

   打开cmd窗口 然后执行ipconfig /flushdns
4.如果有vpn的需要连上vpn

可能出现问题:
Q:无法刷新dns解析缓存:执行期间,函数出了问题:

参照链接:
http://www.xitongcheng.com/jiaocheng/win7_article_28232.html

 

 

 

 

MAC:

  finder-> 右键->前往文件夹-->/etc -->hosts 文件-->完成

 

 

 

 

 

 

 

 

posted @ 2019-06-06 21:39  小白学编程呀  阅读(8153)  评论(0编辑  收藏  举报