LPIC-1 Exam 102 (Linux Administrator) — Question 7
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 answers A and C are valid entries as they follow the required format for the /etc/hosts file, with proper IP addresses and hostnames. Options B and D are incorrect due to the presence of spaces or commas that disrupt the format. Option E is also invalid because it contains an improperly formatted IPv4 address (2003.0.113.15).