今天在办公的MAC上修改 /etc/hosts,但是怎么都不生效,重启MAC也不生效,然后各种google,找到一篇亲测有效的 Stack Overflow 文档,我把具体操作翻译过来:
- move the old file with mv -f /etc/hosts /etc/oldhosts
- create a new file with nano
- populate it with the values of the old file
- save it as /etc/hosts
翻译过来:
- 运行命令: mv -f /etc/hosts /etc/oldhosts
- 运行 nano命令
- 把/etc/oldhosts的内容粘贴
- 把nano保存为 /etc/hosts文件