Change Hostname Linux

Hi all, if you want to change the hostname of your server/under linux operating system, you can follow the steps pasted below.

There are networking programs such as sendmal, apache servers etc use hostname to identify the machine.

The hostname command can be used to change or modify the hostname of a machine, it is for displaying or setting up the current domain or hostname of the system.

Display Hostname : 

You can simply enter ‘hostname’ in the command line to get to know the current hostname of the system.

#hostname

server.nixlinux.com

Change Hostname : 

The following methods can be used to change the hostname depending on your linux distribution.

For operating systems :

Redhat / CentOS / Fedora:

Edit the file, /etc/sysconfig/network :

vi /etc/sysconfig/network

Set hostname to the name that you need to set.

HOSTNAME=server.nixlinux.com

Now save and exit vi editor.

For operating systems :

Debian / Ubuntu:

Edit the /etc/hostname file using your favorite text editor.

vi /etc/hostname

Now, delete the old name and set new name.

server.nixlinux.com

Save and quit the text editor.

That’s it 🙂

3 thoughts on “Change Hostname Linux

  1. eco wool

    Good day! Do you know if they make any plugins to assist with SEO?
    I’m trying to get my website to rank for some targeted keywords but I’m not
    seeing very good success. If you know of any please share.
    Thank you! You can read similar blog here: Warm blankets

  2. eco wool

    Hello there! Do you know if they make any plugins to assist with Search Engine
    Optimization? I’m trying to get my website to rank
    for some targeted keywords but I’m not seeing very good success.
    If you know of any please share. Appreciate it! You can read similar art here:
    Wool product

  3. auto approve list

    My programmer is trying to persuade me to move to .net
    from PHP. I have always disliked the idea because of
    the costs. But he’s tryiong none the less. I’ve been using WordPress on a number of websites for about a year
    and am anxious about switching to another platform.
    I have heard good things about blogengine.net. Is there a way I can import all my
    wordpress content into it? Any kind of help would be really appreciated!!

Leave a Reply

Your email address will not be published.