CompTIA Linux+ Powered by LPI (LX0-104) — Question 15
Which of the following lines are valid in the file /etc/hosts? (Choose TWO correct answers.)
Answer options
- A. 2001:db8::15 www.example.com www
- B. www.example.com www 203.0.13.15
- C. 203.0.113.15 www.example.com www
- D. www.example.com,www 203.0.13.15,2001:db8::15
- E. 2003.0.113.15,2001:db8::15 www.example.com www
Correct answer: A, C
Explanation
The correct options A and C use proper formatting for IPv6 and IPv4 addresses, respectively, followed by their associated hostnames. Option B is invalid because it has an incorrect order with the hostname appearing before the IP address. Option D is incorrect as it uses commas instead of spaces to separate entries, while option E contains an improperly formatted IP address (2003.0.113.15).