Problem
How to set or change the system hostname in Red Hat Enterprise Linux 7
Solution
Follow the below process to set or change the system hostname in Linux 7:
- Login into the system as root or superuser and type the command nmtui.
- It will open the window for Network Manager TUI, select the Set system hostname and click on OK
- Type the new hostname and click on OK, here I have entered the new hostname DCPEPSRWEB1
- Click on OK to confirm the new hostname
- Now select Quit and click on OK.
- Type the command hostname to check the new hostname name which is changed to DCPEPSRWEB1. Earlier it was localhost.
Last Updated: August 14, 2019