Is production: true
#migrated

Title: How to change server hostname

Created: 19 Mar 2023 Modified: 19 Mar 2023

Description:



[Legacy Link]

[Link]

Instructions

Five part to setup

  1. Edit network file

    sudo vim /etc/sysconfig/network
    #Edit hostname
    HOSTNAME={hostname}
    
  2. Edit hosts

    sudo vim /etc/hosts
    ####################
    add hostname to 127.0.0.1 and ::1
    
  3. use hostnamectl command

    hostnamectl set-hostname hostname.domain.com
    
  4. Restart network service

    /etc/init.d/network restart