I’m setting up a new server in Pi. I can access the cockpit with the LAN IP; but hostname.local doesn’t work.
Tom / K5TRA
I’m setting up a new server in Pi. I can access the cockpit with the LAN IP; but hostname.local doesn’t work.
Tom / K5TRA
We’re talking about ASL3, correct?
and you used the Raspberry Pi Imager application to set the hostname?
and you remembered to say YES to apply your customisation settings?
If all of the above is true then my next question is what type of system you are trying to use to connect to the RPi? and are you using LAN or WiFi?
Yes, ASL3. The RPi imager was done on the original image; but this server was leveraged from my “stock” original image by creating a new user in Linux and changing the host name, and editing the ASL conf files and custom shell scripts. All is well except hostname.local isn’t recognized. 'Must be a simple edit to fix this.
From some [old] notes :
sudo apt install -y avahi-daemon
sudo cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services
and
sudo systemctl restart avahi-daemon
Also, if you are Mac user then I highly recommend the Discovery - DNS-SD Browser app.
Thanks again, much appreciated!
WCO, thanks for the tip on avahi. I have used in the past but I can’t recall how it’s configured. My other project works well (the .local thing) on every router I’ve tried. I would like to have avahi running on another Debian-based project. Is there a config file to ensure it shouts its hostname?
As I wrote above, you need to make sure that the “avahi-daemon” package has been installed (and the service started). My observation is that the daemon picks up the current hostname (and sometimes restarted if the name needs to be refreshed). As far as the advertised services, the “sudo cp …” I noted above will advertise the “ssh” service. Other, similar, files can be added for other services.
… and the (avahi-daemon, avahi-daemon.conf, avahi.service) man pages are helpful
Thanks… Yes the package is installed and the service is running, it just doesn’t do the resolution. I was hoping to understand the configuration because it doesn’t seem to be automatic
This is, in general, all handled by Multicast DNS or just “mDNS”. TONS of information online about how to configure it. Some quick thoughts:
The “server” you want to contact needs to be running an mDNS broadcast. For Linux this is the package avahi-daemon
. Just install it with apt install -y avahi-daemon
. It’s disabled by default so you need systemctl enable avahi-daemon && systemctl start avahi-daemon
. In the as-installed configuration, the service will simply broadcast your static hostname - see the output of hostnamectl
. mDNS can advertise services specifically. The ssh.service
file Allan referenced creates a “I’m an SSH server” broadcast for any client that watches and/or uses mDNS for service discovery and use.
Any host that wants to use mDNS needs to be able to receive mDNS. Windows 10/11 by default uses it as does MacOS. Linux “clients” to mDNS also need to have avahi-daemon enabled and running. Any client running a firewall also needs to permit inbound UDP/5353. Again, Windows 10/11 and MacOS do this by default. Linux clients may need adjustment.
Folks, I think I’m close but just not there yet.
Here’s the one that does NOT work:
root@MultIRLP:~# service avahi-daemon status
Avahi mDNS/DNS-SD Daemon is running
root@MultIRLP:~#
This is on Debian. There IS an ssh.service entry in /etc/avahi/services/ folder
The one that DOES work looks like:
[root@40982 W2PW]# systemctl status avahi-daemon
Oct 07 05:00:31 40982 avahi-daemon[278]: Withdrawing address record for 192.168.1.87 on wlan0.
Oct 07 05:00:31 40982 avahi-daemon[278]: Leaving mDNS multicast group on interface wlan0.IPv4
Oct 07 05:00:31 40982 avahi-daemon[278]: Interface wlan0.IPv4 no longer relevant for mDNS.
Oct 07 05:02:01 40982 avahi-daemon[278]: Joining mDNS multicast group on interface wlan0.IPv4
Oct 07 05:02:01 40982 avahi-daemon[278]: New relevant interface wlan0.IPv4 for mDNS.
Oct 07 05:02:01 40982 avahi-daemon[278]: Registering new address record for 192.168.1.87 on wl
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavaila
lines 1-17/17 (END)
This is on ARCH. There was no ssh.service entry in /etc/avahi/services/ folder and it didn’t seem to be necessary. I can always resolve 40982.local for webpages, SSH, never found one not to work.
I hope you folks can spot what I didn’t do.
-Pres W2PW
I’m not clear on what you’re asking?
So, your ARCH system is not working?
From some [old] notes :
pacman -S avahi
cp /usr/share/doc/avahi/ssh.service /etc/avahi/services/
systemctl enable avahi-daemon.service
systemctl start avahi-daemon.service
Also, you are correct that installing the ssh.service entry is generally not required. But, if the the service is available then advertising it can help any mDNS browsing applications that allow click-to-SSH … and remember to update the file if you are not using the default port.
The ARCH system IS working. The Debian is not working. On both platforms the service is running. I flat out copied the .conf file from the working one to the not, no help.
When you say “Arch is working” what precisely do you mean by that? And the same for “Debian not working”. Copying the files from Arch to Debian will not work and make any issue much worse.
What do you mean when you say “The Debian is not working” ?
What type of system are you checking from (PC, Mac, Linux, …) ?
Also, something to check between the two system is the IP’s and netmasks. The systems need to be on the SAME subnet.
Also, if you have a firewall setup/enabled on the non-working system then you need to be sure that you allow UDP port 5353 traffic.
ARCH system works. Windows boxes can find it at 40982.local (40982 is the host name)
The Debian does not work, Windows boxes find nothing. The host name is MultIRLP but http://MultIRLP does not resolve.
Both say the service is running
All devices are on 192.168.1.x
To be clear, you are trying http://MultIRLP.local, correct?
Yes sir yes sir. I didn’t properly write that out