nerdexam
LPI

117-201 · Question #334

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

The correct answer is C. The fields are out of order. See the full explanation below for the reasoning.

Question

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

Options

  • ATwo host names are using the same IP address.
  • BThe server doing the query is on a different subnet.
  • CThe fields are out of order.
  • Dhost2 is not a fully qualified domain name.

How the community answered

(19 responses)
  • B
    11% (2)
  • C
    84% (16)
  • D
    5% (1)

Community Discussion

7
Fatima Z.Fatima Z.Mar 18, 2026

C is your answer, and here is the sticky hook to lock it in forever: think "IP then Name" like "I Need" a host, because in /etc/hosts the IP address always comes FIRST, then the hostname. Those entries have the names listed before the numbers, which flips the required order and breaks lookups cold.

21
Anjali D.Anjali D.Mar 19, 2026

Good hook, Fatima, and worth stacking on that you can have multiple hostnames or aliases after that IP on the same line separated by whitespace, so you might see something like "192.168.1.10 server1 server1.local" but the IP-first rule holds no matter how many names follow it.

0
Mateus R.Mateus R.Mar 15, 2026

The fields are backwards, IP belongs first, then the name, so C.

5
Fatima Z.Fatima Z.Mar 16, 2026

Lock it in with "I before N, just like in DNS PTR zone files, you always PIN the IP first then the Name," and that PIN hook will save you on test day.

0
Mei-Ling H.Mei-Ling H.Mar 23, 2026

I picked D first, but /etc/hosts requires IP before hostname, so C.

4
Anjali D.Anjali D.Mar 1, 2026

I kept staring at option A because having two hostnames share an IP feels wrong, but that is actually valid for aliases and does not cause lookup failures. What clinched C for me is that the /etc/hosts format requires the IP address to come first on each line, and here "host1" and "host2" are sitting in the IP field spot, which means the resolver is trying to look up a hostname where it expects a number.

3
Mei-Ling H.Mei-Ling H.Mar 1, 2026

The format point is solid, but worth naming the exact symptom: when the resolver tries to parse "host1" as an IP it will throw a syntax error and likely skip that line entirely, so both host1 and host2 lose their mappings, not just one of them.

0
Full 117-201 Practice