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.

abhijeet on Facebookabhijeet on Linkedinabhijeet on Twitter
Abhijeet specializes in developing software. A full-stack developer and Entrepreneur, he takes an idea and crafts it into a beautiful product - front to back. He develops on the LAMP Stack (PHP, MVC, Web API, Perl, Python, Azure, AWS, Google Cloud) and utilizes AngularJS and Angular Material for a structured client. Abhijeet is a self-starter with experience working in remote, agile environments mainly focusing on the security constraints. This is the developer, Project Manager and Consultant you are looking for.