how to change hostname?

how to change hostname? i change it by running hostname xxx but it failed.

3 Replies

Hey there,

The answer to your question depends on what Linux distro you're running.

If you check out our Getting Started guide, in the setting the hostname section, you'll see the different commands needed in each distro.

Note that the guide assumes that you're logged into the root user immediately after your first login to your Linode. If you're instead running on a limited user (with sudo access) you'll need to prefix the commands with sudo in order for them to work.

Let us know if you run into any more issues. :)

why I search hostname and found nothing? thanks.

For modern Linuxes that have systemd, you can run:

sudo hostnamectl set-hostname something.example.com

where something.example.com is your hostname.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct