/etc/hosts文件

/etc/hosts文件保存IP地址和hostname之间的映射。格式是:IP地址 canocial_hostname name。举例如下:

127.0.0.1       localhost
192.168.1.10    foo.mydomain.org       foo
192.168.1.13    bar.mydomain.org       bar
146.82.138.7    master.debian.org      master
209.237.226.90  www.opensource.org

尽管现在host table已经被DNS取代了,但是有时在bootstrappingNIS和隔离节点的环境下仍然会用到/etc/hosts
修改/etc/hosts文件可以马上生效,但有时需要清空程序的缓存。

参考资料:
hosts

 

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理