You are not logged in.

#1 2021-12-15 08:13:16

Franco_64
Member
From: Milano, Italy
Registered: 2021-11-20
Posts: 35

[SOLVED] Setting my hostname so it is visible to other LAN devices

Hi all,

I'm trying to set my Arch machine so its hostname is visible to other devices in my LAN, that is connected to Internet via a router with DHCP.

I'm reading https://wiki.archlinux.org/title/Networ … resolution but the article leave me a bit confused... should I edit "by hand" /etc/hosts or this will be overwritten at first restart?

Other devices in my LAN are visible with their hostnames in router's control panel (smartphones, a Raspberry PI...), but my Arch machine appears as "Host-001".

The aim is to reach my Arch machine via SSH (that I configure later...)

Last edited by Franco_64 (2021-12-15 09:52:18)

Offline

#2 2021-12-15 08:29:07

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: [SOLVED] Setting my hostname so it is visible to other LAN devices

Entries in /etc/hosts are not communicated to other nodes, first and formost you need to set a hostname (which is part of the installation guide), https://wiki.archlinux.org/title/Networ … e_hostname
That hostname is then exported w/ the dhcp request, unless the dhcp client is configured to not do so (I don't think that's default anywhere, but we'd still need to hear about your actual network configuration)

hostnamectl
find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

Offline

#3 2021-12-15 09:03:14

Franco_64
Member
From: Milano, Italy
Registered: 2021-11-20
Posts: 35

Re: [SOLVED] Setting my hostname so it is visible to other LAN devices

These are the outputs:

hostnamectl:

Static hostname: Ishmael
Icon name: computer-convertible
Chassis: convertible
Machine ID: 7398c6cf6d804261963d30be7c2e0ab6
Boot ID: aeceb37f776442b2b584d840cdc898a0
Operating System: Arch Linux                           
Kernel: Linux 5.15.7-arch1-1
Architecture: x86-64
Hardware Vendor: HP
Hardware Model: HP Spectre x360 Convertible 13-aw0xxx

systemd:

bluetooth.service                        | bluetooth.target.wants
dbus-org.bluez.service                   | system
dhcpcd.service                           | multi-user.target.wants
dirmngr.socket                           | sockets.target.wants
display-manager.service                  | system
gcr-ssh-agent.socket                     | sockets.target.wants
getty@tty1.service                       | getty.target.wants
gpg-agent-browser.socket                 | sockets.target.wants
gpg-agent-extra.socket                   | sockets.target.wants
gpg-agent.socket                         | sockets.target.wants
gpg-agent-ssh.socket                     | sockets.target.wants
iwd.service                              | multi-user.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire.socket                          | sockets.target.wants
pulseaudio.socket                        | sockets.target.wants
remote-fs.target                         | multi-user.target.wants

Last edited by Franco_64 (2021-12-15 09:40:18)

Offline

#4 2021-12-15 09:19:11

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: [SOLVED] Setting my hostname so it is visible to other LAN devices

Please use code tags, https://bbs.archlinux.org/help.php#bbcode
Check /etc/dhcpcd.conf - is

# Inform the DHCP server of our hostname for DDNS.
hostname

commented?

Offline

#5 2021-12-15 09:51:46

Franco_64
Member
From: Milano, Italy
Registered: 2021-11-20
Posts: 35

Re: [SOLVED] Setting my hostname so it is visible to other LAN devices

seth wrote:

Please use code tags, https://bbs.archlinux.org/help.php#bbcode
Check /etc/dhcpcd.conf - is

# Inform the DHCP server of our hostname for DDNS.
hostname

commented?

YES! After uncommenting and restart the service, all is OK.

Offline

Board footer

Powered by FluxBB