Thank you, Quinn.
It's strange that you have different behavior. Maybe your iPhone was sleeping/not unlocked? I just pinged from local Linux box:
Wife's iPhone SE, iOS 16.6:
$ ping -W 5 -c 1 katias-iphone.local
PING katias-iphone.local (192.168.50.93) 56(84) bytes of data.
64 bytes from 192.168.50.93 (192.168.50.93): icmp_seq=1 ttl=128 time=36.1 ms
Our old Apple TV (A1469), software 7.9(8163):
$ ping -W 5 -c 1 apple-tv.local
PING apple-tv.local (192.168.50.223) 56(84) bytes of data.
64 bytes from 192.168.50.223 (192.168.50.223): icmp_seq=1 ttl=128 time=18.2 ms
My iPad Pro 11" 3rd gen, ipadOS 16.6:
$ ping -W 5 -c 1 filpad.local
PING filpad.local (192.168.50.73) 56(84) bytes of data.
64 bytes from 192.168.50.73 (192.168.50.73): icmp_seq=1 ttl=128 time=3.81 ms
My iPhone 11, iOS 17.0 beta:
$ ping -W 5 -c 1 filphone.local
ping: filphone.local: Name or service not known
I am working on home automation project that need to detect the presence of certainly named device in the local network.
Maybe I can register some Bonjour service on Macbook or Linux, so iPhone will respond by name if it in local network?