What is incorrect about these entries in /etc/hosts which could be causing host name lookup problems with host2?
host1 192.168.1.12 host2 192.168.1.12
A. Two host names are using the same IP address.
B. The server doing the query is on a different subnet.
C. The fields are out of order.
D. host2 is not a fully qualified domain name.
题解
「/etc/hosts」文件用来进行 IP 地址和主机名称的对应。
这题目给的「/etc/hosts」设置并不能让「host1」和「host2」都对应到「192.168.1.12」,因为它们的顺序错了,正确的设置应为:
192.168.1.12 host1
192.168.1.12 host2
选项 A,非问题点。
选项 B,非问题点。
选项 C,正是问题点。
标准的网域名称标签可以包含以下字符:
- a-z
- 0-9
- -
每个标签,以「.」字符来隔开,且长度在 1~63 个字符之间。整个网域名称,包含「.」(但不包含结尾的「.」)的最大长度为 253 个字节。
选项 D,「host2」是正确的网域名称,且问题点也不是出在网域名称的格式。
