XK0-004 · Question #389
A Linux administrator wants to resolve a remote server name locally. When of the following files should the administrator modify?
The correct answer is A. /etc/hosts. The /etc/hosts file is a static local lookup table that maps hostnames to IP addresses, allowing name resolution without relying on DNS.
Question
A Linux administrator wants to resolve a remote server name locally. When of the following files should the administrator modify?
Options
- A/etc/hosts
- B/etc/resorv.conf
- C/etc/network
- D/ett/rpc
How the community answered
(39 responses)- A95% (37)
- B3% (1)
- D3% (1)
Why each option
The /etc/hosts file is a static local lookup table that maps hostnames to IP addresses, allowing name resolution without relying on DNS.
The /etc/hosts file on Linux is consulted before DNS queries by default, making it the correct place to add a static hostname-to-IP mapping for a remote server. An administrator edits this file to resolve a specific remote server name locally by adding an entry in the format 'IP hostname'. This approach is immediate and requires no DNS infrastructure changes.
/etc/resolv.conf configures the DNS resolver settings such as nameserver addresses and search domains, but does not contain static hostname mappings.
/etc/network (or /etc/network/interfaces) defines network interface parameters like IP address and gateway, not hostname resolution records.
/etc/rpc maps RPC program names to their program numbers for remote procedure call services, which is unrelated to hostname resolution.
Concept tested: Static local hostname resolution via /etc/hosts
Source: https://man7.org/linux/man-pages/man5/hosts.5.html
Topics
Community Discussion
No community discussion yet for this question.