Courseiva
Networking →mediumMultiple Choice

Hosts File Causing Hostname Resolution Failure

A user at a small office reports that they can access the internet but cannot connect to the company's internal file server using its hostname (\\fileserver). The user can ping the file server's IP address successfully. The technician checks the workstation's network settings and sees that it is obtaining an IP address from DHCP and the default gateway is correct. The DNS server address is set to the company's internal DNS server (192.168.1.5). Other workstations on the same network can access the file server by hostname without issue. Which of the following is the MOST likely cause of the problem?

Quick Answer

The answer is an incorrect entry in the workstation’s hosts file. This is the most likely cause because the hosts file is checked before any DNS query, so a bad mapping for 'fileserver' to a wrong or unreachable IP would prevent hostname resolution even though the DNS server is correct and other workstations work fine. On the CompTIA A+ Core 1 220-1101 exam, this scenario tests your understanding of the local name resolution order—hosts file, then DNS—and it’s a common trap where students assume a DNS issue when the real problem is a local override. The hosts file is located at %SystemRoot%\System32\drivers\etc\hosts, and a quick check with `ipconfig /displaydns` or by opening the file in Notepad can confirm the error. Memory tip: “Hosts hijack hostnames first”—the hosts file always gets the first look, so if it’s wrong, DNS never gets a chance.

⚠ Common exam trap

Many candidates assume a DNS server misconfiguration or cache corruption is the cause, but the fact that other workstations resolve the hostname correctly isolates the problem to the local workstation's name resolution order, where the hosts file takes precedence over DNS.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

The workstation's hosts file contains an incorrect entry for fileserver.

The user can ping the file server by IP but not by hostname, and other workstations resolve the hostname correctly. This points to a local name resolution issue on the affected workstation. The hosts file (located at %SystemRoot%\System32\drivers\etc\hosts) is checked before DNS queries, so an incorrect entry mapping 'fileserver' to a wrong or unreachable IP would cause the failure while DNS remains functional for others.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The file server's firewall is blocking ping requests.

    Why it's wrong here

    Ping succeeds to the IP address, so the firewall is not blocking ICMP; the failure is name resolution, not reachability. Blocking ping would be relevant when troubleshooting whether a host is reachable at all, but here the hostname lookup itself is what fails.

  • ✗

    The workstation's DNS cache is corrupted.

    Why it's wrong here

    A corrupted DNS cache could cause resolution failures, but since other workstations on the same DNS server resolve correctly, the cache issue would only affect this workstation if it had stale data. However, flushing the cache would be a standard step, but the most likely cause given the scenario is a hosts file entry.

  • ✓

    The workstation's hosts file contains an incorrect entry for fileserver.

    Why this is correct

    A rogue hosts file entry overrides DNS resolution, mapping the hostname "fileserver" to a stale or wrong IP address. Since the hosts file is consulted before the configured DNS server (192.168.1.5), the workstation fails to resolve the correct address even though other machines resolve it fine.

  • ✗

    The file server's network cable is faulty.

    Why it's wrong here

    The workstation pings the file server's IP address successfully, proving the cable and link are functional. A faulty cable would break all connectivity, including ping. This would be the cause only if the server were entirely unreachable rather than reachable by IP but not hostname.

Visual reference

Client DHCP Server 1 Discover (broadcast) 2 Offer (IP: 192.168.1.10) 3 Request (I accept) 4 Acknowledge (lease confirmed) DORA — the four-step DHCP lease process

About these practice questions

This 220-1101 question is part of Courseiva's 896-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on 220-1101

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A user reports that their workstation can access the internet and other network resources by IP address, but cannot connect to an internal file server (fileserver.company.local) by its hostname. Other users on the same network can access the file server by hostname without issue. The workstation's IP configuration is static: IP 192.168.1.10, subnet mask 255.255.255.0, default gateway 192.168.1.1, and DNS server 192.168.1.1. The technician pings the IP address of the file server (192.168.1.100) successfully from the affected workstation. Which of the following is the MOST likely cause of the issue?

medium
  • A.The workstation's network cable is faulty
  • ✓ B.The local hosts file has an incorrect mapping for the file server
  • C.The DNS server is not configured to resolve internal hostnames
  • D.A firewall rule is blocking port 445 (SMB) on the workstation

Why B: The workstation can access resources by IP address but not by hostname, and other users can resolve the hostname successfully, indicating a local name resolution issue. The hosts file on the affected workstation likely contains an incorrect or outdated mapping for fileserver.company.local, overriding DNS resolution. Since the DNS server is working for other users and the workstation can ping the file server by IP, the problem is isolated to the local hosts file.

Variation 2. A user in a small office reports that they can access websites on the internet but cannot connect to the company's internal file server using its hostname (\\fileserver). Other users in the same office can access the file server by hostname without any issues. The technician runs ipconfig /all on the affected workstation and sees the following: IPv4 Address: 192.168.1.45, Subnet Mask: 255.255.255.0, Default Gateway: 192.168.1.1, DNS Server: 8.8.8.8. Which of the following is the MOST likely cause of the issue?

medium
  • A.The workstation's subnet mask is incorrect.
  • ✓ B.The workstation is using an external DNS server instead of the internal DNS server.
  • C.The default gateway is misconfigured.
  • D.The DHCP scope is exhausted.

Why B: The workstation can access the internet (via 8.8.8.8) but cannot resolve the internal hostname 'fileserver' because it is using an external DNS server (Google's 8.8.8.8) instead of the internal DNS server that holds the private DNS records for the company's local resources. Internal DNS servers typically host A or CNAME records for internal hostnames, which public DNS servers like 8.8.8.8 do not contain. This mismatch prevents hostname resolution for the file server while leaving internet access functional.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This 220-1101 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 220-1101 exam.