A Linux administrator is editing /etc/hosts on a database server that uses the fully-qualified domain name intradb.example.com, but some applications still reference the short name intradb. The goal is for both names to resolve locally to 192.168.10.50 before any DNS lookup is attempted. Which of the following single-line entries correctly accomplishes this while following the required field order for the hosts file?
In /etc/hosts the required order is: IP_address, canonical (primary) hostname, then any aliases. Putting the FQDN first ensures commands such as hostname -f return the correct name and that reverse look-ups show the intended canonical host. The line "192.168.10.50 intradb.example.com intradb" satisfies that rule, mapping the address to the canonical FQDN and then to the short alias. All other options break the field order by starting with a hostname or by listing the alias before the canonical name, which can lead to incorrect resolution results.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why does the /etc/hosts file require a specific field order?
Open an interactive chat with Bash
What is the difference between a canonical hostname and an alias?
Open an interactive chat with Bash
Why does /etc/hosts resolution occur before DNS lookups?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .