You are not logged in.

#1 2023-05-11 17:37:50

gremlin
Member
Registered: 2022-07-19
Posts: 18

[solved] Why will hostname not get updated?

$ cat /etc/hosts 
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1 localhost
::1 localhost

# 127.0.0.1 my_name123

And

$ hostname

my_name123

This has remained even after a reboot.

Last edited by gremlin (2023-05-11 20:14:47)

Offline

#2 2023-05-11 17:40:25

wandrien
Member
Registered: 2023-05-11
Posts: 3

Re: [solved] Why will hostname not get updated?

hostnamectl hostname your-host-name

Offline

#3 2023-05-11 17:48:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,491
Website

Re: [solved] Why will hostname not get updated?

/etc/hosts != /etc/hostname


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2023-05-11 18:51:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,292

Re: [solved] Why will hostname not get updated?

And localhost is not a valid hostname and will lead to all sorts of issues if that file leaves any conclusion towards your intention.

Offline

Board footer

Powered by FluxBB