Intermediate
Linux & Shell Scripting
Q77 / 100
What is the purpose of "/etc/hosts" and how does it interact with DNS lookups?
Correct! Well done.
Incorrect.
The correct answer is A) "/etc/hosts" is a local file that maps hostnames to IP addresses and is typically checked before querying DNS servers, allowing administrators to override DNS resolution for specific hosts or define local-only hostnames
A
Correct Answer
"/etc/hosts" is a local file that maps hostnames to IP addresses and is typically checked before querying DNS servers, allowing administrators to override DNS resolution for specific hosts or define local-only hostnames
Explanation
Entries in "/etc/hosts" (e.g. "127.0.0.1 myapp.local") let developers map custom hostnames to specific IPs for local testing without needing actual DNS records, and (depending on nsswitch.conf ordering) usually take precedence over DNS.
Progress
77/100