Established node: sometimes umbrel.local does not resolve, while ping to local IP works, mostly

I have few years old node on raspberry. it works most of the time. often, maybe once per day or once per few hours, i cant ping it as umbrel.local.

So, there are moments when this:

 ping umbrel.local

fails, but this

ping 192.168.0.50

works. Why?

I have just now wrote script that does systematically ping it every minute, and when it fails, it stops and sends me text message. I am attaching it at the bottom. Simpler version is this ping loop from any mac or linux

while true; do ping -c 1 umbrel.local; sleep 59; done

What’s puzzling is that often when i try to ping the IP directly (192.168.0.50 as i fixed on my router) it pings ok. Mostly, but not always. Why that can be? I have tried to read about mDNS and so on but still cant diagnose it any better. something weird is going on. Again, this is established node and it used to work quite fine before. Now, sometimes both name and IP ping fails, and naturally so does ssh and webUI.

here is the testing script fyi:

#!/bin/bash

TARGET=umbrel.local
SLEEPTIME=59

while :
do
        DATE=$(date '+%d/%m/%Y %H:%M:%S')
        ping -c 3 $TARGET &> /dev/null
        if [[ $? -ne 0 ]]; then
             echo "ERROR "$DATE
             echo "sending text message"
             /Users/yourname/smska.sh
             echo -e '\n'
             echo "text sent"
             break
        fi
        echo "ping OK ... $DATE ... sleeping $SLEEPTIME s"
        sleep $SLEEPTIME
done

I often have this issue, but in my case I believe it’s related to it being a dynamic IP.
Given you have a static IP for the Umbrel, you should be able to add it to your device’s hosts file.

Here’s a great guide.