【问题标题】:What is the /etc/hosts behavior with alias or append?别名或附加的 /etc/hosts 行为是什么?
【发布时间】:2016-05-26 10:17:51
【问题描述】:

当我在 /etc/hosts 中定义两个具有相同 ip 的单独条目时,我想发现系统的行为:

192.168.100.1     host1
192.168.100.1     host2

代替:

192.168.100.1    host1     host2

我尝试访问 host1 时的行为发生了变化?

谢谢。

【问题讨论】:

    标签: linux networking host hosts


    【解决方案1】:

    正如男人所说,你不应该:

    本手册页描述了 /etc/hosts 文件的格式。该文件是一个简单的文本文件,它将 IP 地址与主机名相关联,每个 IP 地址一行。对于每个主机,应有一行包含以下信息:

    https://unix.stackexchange.com/questions/102660/hosts-file-is-it-incorrect-to-have-the-same-ip-address-on-multiple-lines

    【讨论】:

    • 非常感谢!我不知道可以从 IP -> 主机名使用主机文件。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-26
    • 2013-10-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多