Exam 102-500 Topic 3 Question 185 Discussion
Actual exam question for Lpi's 102-500 exam
Question #: 185
Topic #: 3
Question #: 185
Topic #: 3
Which command is used to set the hostname of the local system? (Specify ONLY the command without any path or parameters.)
Suggested Answer:
hostname
Explanation:
The hostname command is used to set the hostname of the local system. The hostname command can take a single argument, which is the new hostname to be assigned to the system. For example, to set the hostname to linux, one can run:
hostname linux
The hostname command can also be used without any arguments to display the current hostname of the system. For example, to show the current hostname, one can run:
hostname
The hostname command only changes the hostname temporarily, meaning that the original hostname will be restored after a reboot. To change the hostname permanently, one has to edit the configuration files that store the hostname information, such as /etc/hostname, /etc/hosts, /etc/sysconfig/network, etc. The exact files and commands may vary depending on the Linux distribution and the system initialization process. For more details, please refer to the web search results1 or the question answering results2. References:
Explanation:
The hostname command is used to set the hostname of the local system. The hostname command can take a single argument, which is the new hostname to be assigned to the system. For example, to set the hostname to linux, one can run:
hostname linux
The hostname command can also be used without any arguments to display the current hostname of the system. For example, to show the current hostname, one can run:
hostname
The hostname command only changes the hostname temporarily, meaning that the original hostname will be restored after a reboot. To change the hostname permanently, one has to edit the configuration files that store the hostname information, such as /etc/hostname, /etc/hosts, /etc/sysconfig/network, etc. The exact files and commands may vary depending on the Linux distribution and the system initialization process. For more details, please refer to the web search results1 or the question answering results2. References:
by Jacob at Mar 05, 2026, 07:04 AM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).