Server doesn't respond to top level ".local" domain name but my other devices do

I have Ubuntu Server 22.04 on my network. I have my router (Fresh Tomato) resolving local domain names. Weirdly, I can ping or navigate in a browser to any device with <hostname>.local except for the server which I can only ping or connect to my Nextcloud with JUST <hostname>.

If I ping <hostname> from another device the return is:

64 bytes from <hostname>.local (192.168.1.50)

but if I ping <hostname>.local I get “name or service not known”

Alternatively, from the server itself I can ping it’s own <hostname>.local address and the output is the same as above.

64 bytes from <hostname>.local (192.168.1.50)

If I ping <hostname> from the server itself it returns

64 bytes from hostname (127.0.1.1)

Any idea what is up? Would be great to have consistency across my whole network.

How does your hosts file and hostname file look?

cat /etc/hosts

127.0.0.1 localhost
127.0.1.1 breakfast
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Servers hostname is breakfast (it’s the most important meal of the day I’m told)

cat /etc/hostname

breakfast

Looks the same as my desktop’s hosts and hostname files (other than the actual name of course)

As far as I know, you aren’t supposed to use .local as a TLD, because mDNS can interfere with it, so you could try to change it to something else like .lan instead.

1 Like

I concur however, you might be able to try setting in your /etc/hosts:

127.0.1.1 breakfast.local breakfast

See how that works…

I think I recall hearing this somewhere but forgot about it. I changed the domain in the router to .lan and that fixed the issue instantly. Thanks!

You’re welcome, glad to help.