avahiを利用して

Avahi のインストールと起動

sudo apt update
sudo apt install -y avahi-daemon avahi-utils

# 必要に応じて
sudo systemctl enable avahi-daemon
sudo systemctl start avahi-daemon
sudo apt install -y avahi-daemon libnss-mdns avahi-utils

Avahi デーモン本体(avahi-daemon)
mDNS 名解決連携(libnss-mdns)
CLI ツール群(avahi-utils)

mDNSの確認

hitto@mdns:~$ avahi-resolve-host-name  mdns.local
mdns.local	2001:ce8:115:8c7e:be24:11ff:fea4:e2ce
hitto@mdns:~$ getent hosts mdns.local
2001:ce8:115:8c7e:be24:11ff:fea4:e2ce mdns.local
fdbe:d2:8bef:d1db:be24:11ff:fea4:e2ce mdns.local
fe80::be24:11ff:fea4:e2ce mdns.local
hitto@mdns:~$ avahi-resolve-host-name mdns.local
mdns.local	192.168.0.50

conf

hitto@mdns:~$ cat /etc/avahi/avahi-daemon.conf 
← Go home