B) /etc/hosts ✅
The /etc/hosts file provides static hostname ↔ IP address mappings on a local machine.
Example:
127.0.0.1 localhost
192.168.1.10 fileserver
When the system resolves a hostname, it typically checks /etc/hosts before querying DNS (depending on the resolver configuration).
Quick contrast:
/etc/passwd → user account information
/etc/group → group information
/etc/shadow → password hashes and password policy data
LINUX KNOWLEDGE CHECKPOINT
Which file is commonly used to configure static hostname-to-IP mappings on a Linux system?
A) /etc/passwd
B) /etc/hosts
C) /etc/group
D) /etc/shadow