Set hostname

From vpsget wiki
Jump to: navigation, search

Set host name on Centos:

/etc/sysconfig/network


HOSTNAME="mycomputer"


/etc/hosts wrote:

127.0.0.1 mycomputer.mydomain.local mycomputer


check it with

hostname
hostname --fqdn
hostname -a

Set hostname on Ubuntu:

Edit file /etc/hostname Simply enter hostname into the file.

hostname

To avoid restart you can use next:

sudo hostname your-new-name

This will set the hostname to your-new-name until you restart. ""