How to rename the SQL Server Network Name of a failover cluster
Sometimes there may be a need to rename the SQL Server Network Name for a failover cluster and in this tip we will walk through the steps needed to successfully rename the SQL Server Network Name for a failover cluster.
The SQL Server Network Name is used to identify a failover cluster on the network. This was known as the virtual SQL Server name in earlier versions of SQL Server failover clusters. When you connect to SQL Server using this name, this will connect to the current online node.
Rename the SQL Server Network Name
Step 1 - Get the current SQL Server Network Name
The first step is to get the current SQL Server network name of the failover cluster. You can check the name multiple ways. You can run the below T-SQL command to get the SQL Server network name.
Or you can launch the Failover Cluster Manager to check the virtual server name as shown below.
In both options, we can see the current SQL Server Network Name is MSSQLCLUSTER.
Step 2 - Change the SQL Server Network Name
From with the Failover Cluster Manager, right click on the Server Name and choose Properties as shown in the below screenshot.
The SQL Server Network Name property window will appear as shown in the below screenshot. Here you can see the "DNS Name" as MSSQLCLUSTER. This is where you need to change the SQL Server Network Name.
I changed my SQL Server Network Name from MSSQLCLUSTER to SQLCLUSTER as shown in the below screenshot. Once you change the name, click the Apply button.
Once you click the "Apply" button, it will ask you to confirm this change as shown below. You will get the message "This change requires clients to update the name used to connect to this clustered role. You will also need to manually restart any service or application that depends on this resource. Are you sure that you want to make this change?". Click Yes to accept the change.
After clicking Yes, this setting will be saved and the process bar will look like the below screenshot.
Step 3 - Verify the SQL Server Network Name Change
We have renamed our SQL Server Network Name for this failover cluster. You can verify this change by running the following T-SQL command.
Or you can verify the name change in the Failover Cluster Manager as shown below.
Step 4 - Test Old SQL Server Network Name
If you try to connect to SQL Server using the previous name, you will get the following error.
Step 5 - Cycle Resources and Services
Although you will be able to make a connection using the new SQL Server Network Name, Microsoft recommends taking the SQL Server network resources offline and bringing them back online after the modification. To do so right click on the SQL Server Network Name and click on the "Take Offline" option.
Once the resources are offline, the interface will look like the below screenshot.
Now right click on the Server Name again and click "Bring Online". Once you bring the SQL Server Network Name resource online, SQL Server will not come online automatically because the SQL Server services are set to Manual mode in a failover cluster environment, so you will need to manually bring these services online.
Step 6 - Validate changes by testing failover
First check the owner node for SQL Server. We can run the following T-SQL command and see that SQL-NODE1 is the current owner node.
Now open the Failover Cluster Manager and initiate a failover. You can right click on the SQL Server instance and choose the "Move" > "Best Possible Node" option. As our cluster is a two-node cluster, it will failover to the second node.
Once the failover is successful, again connect to the SQL Server instance by using the new SQL Server Network Name and run the below T-SQL command. We can see that SQL Server is online on SQL-NODE2 from the below screenshot.
You can also check the active node in the Failover Cluster Manager as shown below.
- Now that you have renamed your SQL Server Network Name, you will need to wait a bit for the new name to be propagated across the network and at that point the SQL Server instance will be accessible from other machines on the network as well.
- Be sure to validate all applications are running properly after the rename and the failover.
- Make sure connections are changed to connect to the new SQL Server Network Name.
- Explore more knowledge on SQL Server Database Administration Tips.
About the author
View all my tips