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

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 anyname.yourdomain.com

Step 2: Change Hostfile

Use any editor I used nano

# sudo nano /etc/hosts/

 

127.0.0.1               localhost localhost.localdomain
54.xxx.xx.151           anyname.yourdomain.com
10.0.0.10               anyname.yourdomain.com anyname ip-10-0-0-10

 

 

Step 3: Change Network Config

# sudo nano /etc/sysconfig/network

 

HOSTNAME="anyname.yourdomain.com"
NETWORKING=yes
NOZEROCONF=true

 

Step 4: Change Nameserver IP’s of Cpanel Server

sudo nano/var/cpanel/nameserverips.yaml

 

--
ns1.yourdomain.com:
54.xxx.xx.151: 1
count: '14'
zones: anyname.yourdomain.com,domain2.com,ns1.yourdomain.com$
ns2.yourdomain.com:
54.xxx.xx.151: 1
count: '14'
zones: anyname.yourdomain.com,domain2.com,ns1.yourdomain.com$

 

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

Hope you enjoyed reading this.

About author

You might also like

Server Installations 0 Comments

Complete Ubuntu Configuration with sudo + inst + gcc + ip tool + locate database + Apache Web Server and PHP +Gnome 2.x + xWindow

I am a fan of CentOS for web server and Ubuntu for desktop. Ubuntu comes with many updated distributions like PinguyOS, Mint, Ultimate Edition and many  more.. but for your

Server Installations 2 Comments

Complete FFMPEG + FLVtool2 + mplayer + a52 + FADD2 + FAAC + LAME + YASM + x264 + Xvid + Opencore AMR + installation on Cent os 5.x and Red Hat

I hope this tutorial will help to those who are struggling to figure out how to get FFMPEG to install and to have it work with as many input video

Server Installations 0 Comments

How to install PHP + MySQL + phpMyAdmin on Linux, Ubuntu or Fedora Web Server.

Lets start with most popular and widely used Linux distribution Ubuntu. First of all lets understand what is LAMP. LAMP is an acronym for a solution stack of free, open