Article

Table of Contents
Theme:
Was this article helpful?
Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $300 by adding new articles!

Change Hostname on CoreOS

Last Updated: Mon, Aug 24, 2020
Best Practices CoreOS System Admin

Introduction

Use this guide to learn how to rename your CoreOS server from the command line.

Examples

This guide uses olddog for the old hostname and newtricks for the new hostname.

1. Become Root

Connect to your FCOS instance and change to the root user.

$ sudo su - root

2. Check the Current Hostname

Check the hostname with hostname.

# hostname
olddog

You can also use hostnamectl.

# hostnamectl 
 Static hostname: olddog
       Icon name: computer-vm
         Chassis: vm
      Machine ID: 257f49f8befd44caade69b87d7b39b22
         Boot ID: 5e111bff48644734988905c7cad7161b
  Virtualization: kvm
     CPE OS Name: cpe:/o:fedoraproject:fedora:32
          Kernel: Linux 5.7.8-200.fc32.x86_64
    Architecture: x86-64

3. Change Hostname

Change the hostname to newtricks.

# hostnamectl set-hostname newtricks

4. Confirm the Change

Reboot the server.

# reboot

Test your change with hostnamectl and hostname.

$ hostnamectl 
   Static hostname: newtricks
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 00c6efc1008d46aabeed06a3b8a459ec
           Boot ID: 539da7ee88a1499db77d3ef8b82b7a72
    Virtualization: kvm
            Kernel: Linux 5.4.0-26-generic
      Architecture: x86-64

$ hostname
newtricks

Update DNS

Your server hostname is changed and ready to use. This procedure does not change your DNS name, and you'll need to perform those steps at your domain registrar.

Want to contribute?

You could earn up to $300 by adding new articles