Most of the time on cPanel dedicated server we add nameservers from WHM but some time we are not able to access WHM. In that case we can add nameservers from shell by using root login details.
Login in to server as root user and run following commands.
root@server[~]#/scripts/adddns –domain ns1.your_domain.com –ip=111.222.222.1
root@server[~]#/scripts/adddns –domain ns2.your_domain.com –ip=111.222.222.2
You can use your domain name instead of your_domain.com in above command with the respective ips which you want to use for your nameservers.
root@server[~]#service named restart
or
root@server[~]#/etc/init.d/named restart