Which file would you configure if you want to change the resolution order for hostnames?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The correct file to configure when changing the resolution order for hostnames is the /etc/nsswitch.conf file. This file defines the order in which different sources are queried when resolving names and other operations such as user and group lookups.

In the context of hostname resolution, the /etc/nsswitch.conf file usually contains a line that specifies how the system should resolve hostnames, typically with entries like "hosts: files dns". This configuration means that the resolver will first check local files (like /etc/hosts) for hostname resolution before querying DNS servers. By modifying this line, you can control whether to prioritize local files, caches, DNS lookup, or any other name resolution services.

The other files mentioned serve different purposes:

  • The /etc/hosts file is used for static hostname resolution but does not manage the order of resolution.
  • The /etc/services file contains network services and their associated port numbers, irrelevant to hostname resolution.
  • The /etc/resolv.conf file is primarily used for configuring DNS servers for hostname resolution but does not dictate the order of lookup sources.

Understanding the role of /etc/nsswitch.conf and how it integrates various name resolution methods is crucial for effectively managing hostname resolution in a Linux environment.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy