How to change server hostname and name servers via SSH – Commandline cpanel server

This is my first article after long time. I hope very soon I can publish more networking and server related tricks and topics in

this block.

Here we go with very short and effective article for changing Hostname and Nameservers of the server

Step 1. Change Server Hostname

# hostname

Step 2: Change Hostfile

Use any editor I used nano

# sudo nano /etc/hosts/               localhost localhost.localdomain      anyname ip-10-0-0-10



Step 3: Change Network Config

# sudo nano /etc/sysconfig/network




Step 4: Change Nameserver IP’s of Cpanel Server

sudo nano/var/cpanel/nameserverips.yaml


-- 1
count: '14'
zones:,,$ 1
count: '14'


Final Step will be register your nameserver IP’s with your domain registrar and use your own nameservers.

Hope you enjoyed reading this.