• Run the below commands to change your server's hostname to "sendy"

    sudo hostnamectl set-hostname sendy

    sudo hostnamectl set-hostname "sendy" --pretty

  • Run the below command to make sure that the hostname was changed successfully:

    hostnamectl

  • Run the following command to open the /etc/hosts file with vi:

    sudo vi /etc/hosts

  • Insert a new line to the top of this file to indicate your new hostname. This new line should look like what is highlighted in blue below:

    **127.0.0.1 sendy
    127.0.0.1 localhost
    # The following lines are desirable for IPv6 capable hosts
    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts**
    
  • Press Esc, then press the colon key (:), then type wq and then press Enter to save the changes and then close vi.

  • Run the following command to disconnect from the server:

    exit

  • Connect back into the server again using Putty and make sure that your command prompt shows the new hostname. Your command prompt should look similar to this:

    **ubuntu@sendy:~$**