Hostname – The term is defined as the human-readable name used as nick name to the device. It generally connected to the network such as NIS (Network Information System), DNS (Domain Name server), SMB (Server Message Block). In this article we are going to explain two methods to change the hostname, you can adopt the easy method. Naming the hostname in cPanel is usual thing but changing the current name as per your requirement needs the detailed steps:
With manual concept, you can follow the below steps:
Step 1: Open the WHM and login as the root administrator.
Step 2: Click the "Networking SetUp" and choose the "change hostname".
Step 3: You can enter the hostname as per your requirement eg: host.domainname.com
Step 4: After entering the name tap the change button and within few seconds you will get the message saying changing hostname…done.
Step 5: Now, move your mouse at the page bottom and tap “Add an A entry for your hostname”.
Step 6: You will get the box to enter the IP address. After entering it tap the “ADD Entry”.
Step 7: You will get the message as “Adding the entry…done”. Now you have changed the hostname.
Steps to change the hostname through command line:
In case of Linux, we would have the command line such as hostname.server.domain.com
Keep below instructions in mind before setting the hostname:
Let’s see the method to change the hostname.
Here newhostname is the name which you wish to use on your server.
Hostname set to: newhostname
Note: You have changed the hostname in command line prompt with above method. It is very simple and easy to execute.
With manual concept, you can follow the below steps:
Step 1: Open the WHM and login as the root administrator.
Step 2: Click the "Networking SetUp" and choose the "change hostname".
Step 3: You can enter the hostname as per your requirement eg: host.domainname.com
Step 4: After entering the name tap the change button and within few seconds you will get the message saying changing hostname…done.
Step 5: Now, move your mouse at the page bottom and tap “Add an A entry for your hostname”.
Step 6: You will get the box to enter the IP address. After entering it tap the “ADD Entry”.
Step 7: You will get the message as “Adding the entry…done”. Now you have changed the hostname.
Steps to change the hostname through command line:
In case of Linux, we would have the command line such as hostname.server.domain.com
Keep below instructions in mind before setting the hostname:
- Always use FQDN (fully qualified domain name) as a hostname that contains two periods (ex- hostname.domainname.com).
- Always use lowercase letters in your hostname.
- Hostname does not begin with www or a number or ends with hypen (-).
- Don’t use proxy subdomain as a hostname.
- You have to pick the hostname like no one should choose in past or present.
- It should consist of domain and name because it appears in mail headers.
Let’s see the method to change the hostname.
Code:
# /usr/local/cPanle/bin/set_hostname newhostname
Hostname set to: newhostname
Note: You have changed the hostname in command line prompt with above method. It is very simple and easy to execute.