CompTIA Linux+ (XK0-004) — Question 132

A systems administrator clones copies of a Linux VM every time a new Linux server is needed. The administrator notices the command prompt always states localhost.localdomain.
Which of the following should the administrator run to have the command prompt consistently labeled as Server1 rather than localhost.localdomain?

Answer options

Correct answer: C

Explanation

The correct answer, C, sets the hostname to 'Server1' with a pretty name, which affects how the system presents its hostname. Options A and B do not change the system's hostname directly, while options D and E set transient and static hostnames, respectively, but do not provide the same user-friendly output as option C.