Why why does the node get the hostname like this? @localhost.localdomain

Why is the name like that, and not the real name registered in etc/hosts?

the application starts and I see that it does not receive the host name, I don’t understand what could happen?

the application gets the domain name as @localhost.localdomain

I think this is a MacOS thing, look for “hostname” in settings and change it in the 2 or 3 places it comes up. If this is a BSD or Linux then yes that’s weird but tell us which OS and what is in /etc/resolv.conf or where ever systemd has decided to put things.

NAME="openSUSE Tumbleweed"
# VERSION="20240412"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20240412"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
# CPE 2.3 format, boo#1217921
CPE_NAME="cpe:2.3:o:opensuse:tumbleweed:20240412:*:*:*:*:*:*:*"
#CPE 2.2 format
#CPE_NAME="cpe:/o:opensuse:tumbleweed:20240412"
BUG_REPORT_URL="https://bugzilla.opensuse.org"
SUPPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Tumbleweed"
LOGO="distributor-logo-Tumbleweed"

cat /etc/hostname
linux-9y35.localhost

type or paste code here

On Linux, the systemd desertification has long consumed this old Unix feature, so you have these commands to check:

$ hostnamectl --transient
$ hostnamectl --static
$ hostnamectl --pretty
$ hostnamectl --json=pretty

or if you have an older version of hostnamectl, check its help.

linux-9y35:~ # hostnamectl --transient
localhost
linux-9y35:~ # hostnamectl --static
linux-9y35.localhost
linux-9y35:~ # hostnamectl --pretty

linux-9y35:~ # hostnamectl --json=pretty
{
	"Hostname" : "localhost",
	"StaticHostname" : "linux-9y35.localhost",
	"PrettyHostname" : null,
	"DefaultHostname" : "localhost",
	"HostnameSource" : "transient",
	"IconName" : "computer-laptop",
	"Chassis" : "laptop",
	"Deployment" : null,
	"Location" : null,
	"KernelName" : "Linux",
	"KernelRelease" : "6.8.5-1-default",
	"KernelVersion" : "#1 SMP PREEMPT_DYNAMIC Thu Apr 11 04:31:19 UTC 2024 (542f698)",
	"OperatingSystemPrettyName" : "openSUSE Tumbleweed",
	"OperatingSystemCPEName" : "cpe:2.3:o:opensuse:tumbleweed:20240412:*:*:*:*:*:*:*",
	"OperatingSystemHomeURL" : "https://www.opensuse.org",
	"HardwareVendor" : "Lenovo",
	"HardwareModel" : "ThinkPad E14 Gen 2",
	"HardwareSerial" : "PF2ST3D1",
	"FirmwareVersion" : "R1EET32W(1.32 )",
	"FirmwareVendor" : "LENOVO",
	"FirmwareDate" : 1609804800000000,
	"MachineID" : "bc267f7f79c74474baf4d0c659b066ec",
	"BootID" : "98db592931e643b1bcd031c798f23f0a",
	"ProductUUID" : "6182becc243111b2a85cb31f5c19a59e"
}

Your HostnameSource is “transient” and your transient hostname is “localhost”. Consider:

$ hostnamectl --json=pretty|head -6
{
        "Hostname" : "example",
        "StaticHostname" : null,
        "PrettyHostname" : null,
        "DefaultHostname" : "fedora",
        "HostnameSource" : "transient",
$ erl -sname foo
Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Eshell V14.2.5 (press Ctrl+G to abort, type help(). for help)
(foo@example)1> 
$ erl -name foo
2024-06-24 21:30:39.346202 
    args: []
    label: {error_logger,info_msg}
    format: "Can't set long node name!\nPlease check your configuration\n"
...
$ hostnamectl --transient hostname example.com
$ erl -name foo
Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Eshell V14.2.5 (press Ctrl+G to abort, type help(). for help)
(foo@example.com)1> 
1 Like