Update console commands, show more output

This commit is contained in:
Brett Weir 2026-07-16 22:25:10 -07:00
commit c5bf1c8b94

View file

@ -8,7 +8,7 @@ This is useful in small networks, homelabs, or any other environment where clien
== About mDNS
mDNS, short for https://en.wikipedia.org/wiki/Multicast_DNS[Multicast DNS], resolves hostnames to IP addresses by broadcasting queries directly to all machines on the local network using multicast.
mDNS, short for https://en.wikipedia.org/wiki/Multicast_DNS[Multicast DNS], resolves hostnames to IP addresses by broadcasting queries directly to all hosts on the local network using multicast.
mDNS has a special `.local` top-level domain, and domains ending in `.local` are resolved via mDNS instead of DHCP or a DNS server.
@ -16,15 +16,34 @@ With mDNS configured, you can access your server without knowing its IP address,
== Do I already have mDNS?
You can test whether your machine responds to mDNS queries by pinging `<hostname>.local`, where `<hostname>` is the hostname of your server, from another device.
You can test whether your server responds to mDNS queries by pinging your server from another device, using both its IP address and its local domain `<hostname>.local`, where `<hostname>` is the hostname of your server.
For example, if your hostname is `fedora`, your mDNS domain name is `fedora.local`:
Here is a successful ping via IP address:
[source,console]
----
$ ping fedora.local
$ ping -c 3 192.168.1.10
PING 192.168.1.10 (192.168.1.10) 56(84) bytes of data.
64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=3.64 ms
64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=3.77 ms
64 bytes from 192.168.1.10: icmp_seq=3 ttl=64 time=4.04 ms
--- 192.168.1.10 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 3.635/3.814/4.042/0.169 ms
----
If you don't get a response, continue to set up mDNS on your server.
Here is an unsuccessful ping via local domain:
[source,console]
----
$ ping -c 3 fedora.local
ping: fedora.local: Name or service not known
----
If your server is on the same responds to ping via IP but not via local domain, mDNS is not configured.
Read on to learn how to configure mDNS.
== Install Avahi
@ -46,11 +65,11 @@ You can check with `systemctl status` to see if Avahi is already enabled:
----
$ systemctl status avahi-daemon.service
○ avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; preset: enabled)
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; disabled; preset: enabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: inactive (dead)
TriggeredBy: ○ avahi-daemon.socket
Active: inactive (dead) since Thu 2026-07-16 22:19:55 PDT; 1min 2s ago
...
----
It is disabled, so let's enable it:
@ -58,6 +77,9 @@ It is disabled, so let's enable it:
[source,console]
----
$ sudo systemctl enable --now avahi-daemon.service
Created symlink '/etc/systemd/system/dbus-org.freedesktop.Avahi.service' → '/usr/lib/systemd/system/avahi-daemon.service'.
Created symlink '/etc/systemd/system/multi-user.target.wants/avahi-daemon.service' → '/usr/lib/systemd/system/avahi-daemon.service'.
Created symlink '/etc/systemd/system/sockets.target.wants/avahi-daemon.socket' → '/usr/lib/systemd/system/avahi-daemon.socket'.
----
`avahi-daemon.service` is running:
@ -69,20 +91,8 @@ $ systemctl status avahi-daemon.service
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; preset: enabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: active (running) since Fri 2026-06-12 21:40:01 PDT; 7s ago
Invocation: 355fe59c25e046708fdb630ea20330b1
TriggeredBy: ● avahi-daemon.socket
Main PID: 3666 (avahi-daemon)
Status: "avahi-daemon 0.8 starting up."
Tasks: 2 (limit: 153598)
Memory: 2.5M (peak: 2.5M)
CPU: 15ms
CGroup: /system.slice/avahi-daemon.service
├─3666 "avahi-daemon: running [fedora.local]"
└─3667 "avahi-daemon: chroot helper"
Jun 12 21:40:01 fedora avahi-daemon[3666]: Joining mDNS multicast group on interface lo.IPv6 with address ::1.
Jun 12 21:40:01 fedora avahi-daemon[3666]: New relevant interface lo.IPv6 for mDNS.
Active: active (running) since Thu 2026-07-16 22:22:37 PDT; 42s ago
...
----
No additional configuration is necessary for Avahi itself.