How do I change my VPS's hostname

If you want to change your Virtual Private Server's hostname, you first need to login to your VPS via SSH.

  1. Then, edit /etc/sysconfig/network and change the current hostname to the new hostname. You can either use pico, or nano, or vi, or any other editor that you're familiar with 
  2. Once done, edit /etc/hosts and update the hostname there as well. 
  3. Finally, run hostname {new.hostname} to change it globally. 
  4. You may need to reboot for the kernel to see the new hostname as well.
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How can I set a nice looking bash prompt on my Linux VPS?

Add the following lines to the end of /etc/profile PS1="\[\e]2;\u@\H...

What is a Virtual Private Server?

A Virtual Private Server, or VPS is simply put, a "slice" of a dedicated server. Dedicated...

How can I secure my VPS?

If you own, or run a Virtual Private Server, or Dedicated server on the internet, then you need...

how do I disable root logins?

Disabling direct root login to your VPS is almost a must!...

How to change SSH default port

Most script kiddies & crackers will first try and telnet to a server to see if Telnet is...