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」是正確的網域名稱,且問題點也不是出在網域名稱的格式。