By: Manvendra Singh | Updated: 2018-02-14 | Comments | Related: > SQL Server on Linux
Problem
We needed to install SQL Server 2017 on a Red Hat Linux Server (RHEL), but the name of the server did not conform to our naming conventions. Before installing SQL Server on this Linux server, we needed to change the hostname per our naming convention. Please read this tip to understand how to change a Red Hat Linux Server hostname.
Solution
Our client has decided to move SQL Server to Linux for one of their applications. In order to do this migration, we started doing testing and proof of concept with SQL Server on Linux. We were installing SQL Server 2017 on the RHEL server, but quickly noticed that the RHEL host name did not follow our naming convention, so we decided to change the name to meet the naming convention.
Rename Red Hat Linux Hostname
We will use a user interface tool nmtui also known as Network Manager Text User Interface to change the hostname. Follow the below steps to rename a Red Hat Linux server hostname.
NOTE: I would recommend not doing it directly on a production server until after you have tested this in a lower life cycle environment.
Step 1
We will be using nmtui text user interface tool to change the hostname of the RHEL server. The text user interface tool nmtui can be used to configure an interface in a terminal window.
Type nmtui on your terminal window to start the tool and press enter.
#Launch nmtui (Network Manager Text User Interface) nmtui
Step 2
Once you press enter, you will get the below screen on your machine to proceed with the hostname change.
You can see all options that you can do using this tool. As we have to change the hostname of this RHEL server, we will choose the last option that is “Set system hostname”. Go to this option and press enter as shown in the above screenshot.
Step 3
Once you press enter, an editable popup will open on the screen with the current hostname of the system. You can see this in the below screenshot. You can see the current hostname of this system is RHEL. (Note: I have hidden the actual name in the screenshot due to privacy.)
Step 4
Now we will change this name to as per our naming convention. You can remove this name and type what is needed. I have just added -nmtui to the name, so that we can easily identify and validate the new name. Have a look at the below screenshot to see the new name of this system hostname.
Step 5
Once you enter for the new name in above screen, press OK to apply this change. Once you click OK it will ask again to confirm the new name for the system hostname as shown in the below screenshot. Click OK to apply this change to the system.
Step 6
Once you click OK on the above screenshot, your system hostname will be changed to the new name. We can validate this change by looking at the hostname of this Linux machine. A restart of the server is not required.
Simply type “hostname” on your terminal screen and press enter to get the hostname of your Linux system. You can see the new name is shows as RHEL-nmtui.
Next Steps
- Go ahead and install SQL Server on Linux.
- Read more articles on SQL Server on Linux.
- Explore more knowledge on SQL Server Database Administration Tips.
About the author
This author pledges the content of this article is based on professional experience and not AI generated.
View all my tips
Article Last Updated: 2018-02-14