LFCS Networking Practice Question
A Linux server's primary interface is ens3. Administrators report that after a recent reboot, the server's hostname resolves to 127.0.1.1 instead of its static address 203.0.113.25. The file /etc/hosts currently contains only the default '127.0.0.1 localhost' line. Which single change will make the hostname resolve to 203.0.113.25 for local lookups while leaving DNS resolution for all other names untouched?
⚠ Common exam trap
The trap here is assuming the loopback alias 127.0.1.1 is the correct fix for any hostname resolution problem, when the requirement is a specific routable address.
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
✓
Add the line '203.0.113.25 server1.example.com server1' to /etc/hosts.
Local name resolution follows the order defined in nsswitch.conf, which by default checks the hosts file before DNS. Because the hosts file only contains the loopback line, the hostname has no local mapping. Adding a hosts entry that pairs the hostname and FQDN with the actual interface address makes the machine resolve its own name to 203.0.113.25 without disturbing DNS lookups for any other domain.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Add the line '127.0.1.1 server1.example.com server1' to /etc/hosts.
Why it's wrong here
127.0.1.1 is a loopback alias commonly used by Debian-derived systems for the local hostname, but the requirement is that the hostname resolve to the routable address 203.0.113.25. Adding this line would actually preserve the reported problem, mapping the name to a loopback address instead of the interface address.
- ✗
Add 'hosts: dns files' to /etc/nsswitch.conf so DNS is consulted before the hosts file.
Why it's wrong here
Reordering nsswitch.conf to query DNS first would not help because there is no DNS record for the hostname in this scenario, and it would slow local resolution by forcing a network lookup for every name. It also changes global resolution behavior, which the requirement explicitly says should be left untouched for other names.
- ✗
Add an A record for server1.example.com pointing to 203.0.113.25 in the zone file on the authoritative DNS server.
Why it's wrong here
A public or authoritative A record affects resolution performed by other hosts querying DNS, not the local host's own lookup path. Since the reported symptom is local hostname resolution and the hosts file lacks an entry, adding a zone record on a remote server will not change what this machine returns for its own name.
- ✓
Add the line '203.0.113.25 server1.example.com server1' to /etc/hosts.
Why this is correct
The hosts file is consulted before DNS by the default nsswitch.conf ordering, so adding the static address with the hostname makes local resolution return 203.0.113.25. This is the standard fix when a host needs its own FQDN and short name mapped to a routable address rather than the loopback alias, and it does not affect resolution of any other domain.
Visual reference
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
One of 406 original LFCS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint
This LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.