Logon to the domain controller using domain Administrator credentials.
Server Manager > Tools > DNS > Expand the domain controller > Right click Forward Lookup Zones > New zone > Primary Zone > Next > new domain name (second.com) > Allow both non-secure and secure dynamic updates > Finish
Run command prompt as an Administrator and run the following commands.
cd C:\Windows
cd temp
rendom /list
Edit C:\Windows\Temp\Domainlist and rename old domain name (first.com) to new domain name (second.com) as shown below.
Save the file and run the following command in the previous opened command prompt session.
rendom /upload
Followed by the following command
rendom /prepare
Continue to execute the procedure with the following command
rendom /execute
Once the server gets restarted, the domain name will be successfully renamed to the new domain name (second.com)
Logon to the server using new domain credentials.
Rename the server full name if required in the control panel.