Different way to find a computer on the LAN

I have 4 computers connected to an eth switch with a file server and the router.
On each one is installed EOS but in different versions.
The way of addressing the file server is different:

  1. ping hostname
  2. ping hostname.local
  3. ping hostname.lan

Can anyone tell me what it depends on and how I can standardize the way of access, preferably using mode 1 ?
Thank you.

You could enter the host names and IP in /etc/hosts file. then run the 1st command.

Thank you, I knew it, but it is not very practical. If I add a resource to the network I must modify the configuration in all the machines to allow to to talk them each other. But I would like to understand why there are different way to addressing the network resources and what it depends. It might depend from the firewalld that in early versions was not installed by default ? Or from other system parameters. On all the computer is installed avahi. With the oldest EOS version I can use the 1 or 3 mode, but not the 2. In some case to the ping command replies the IPV4 address, in other the IPV6.

Namely I would like EOS retrieves the network resource address trough the host name with a standard configuration on all the computers and it could update automatically when it has been added a new resource to the network.

Then you need your own DNS for your lan or some service like avahi running on every device.
Avahi uses .local as far as I know and it requires some ports open in the firewall and other configuration (see wiki).

An own DNS it seem too much… Avahi is enough because it is a zero-configuration networking.
So far where I’ve used it I haven’t had to open any ports in the firewall. It is installed on all machines.
If avahi uses hostname.local why in some case I need to use hostname.lan and in other the hostname without suffix to retrieve the LAN resources ? This is my initial question.

Maybe - depending on your network. I can add dns entries to my router so they are read before it has to querry dns from the internet. Since my devices have static IPs it is a trivial task to create my own DNS entries.

If you are running PiHole you can also add some static dns entries there.

wiki states for avahi


Be sure to open UDP port 5353 if you are using a firewall.

So thats about that. It should not work if the IN ports are blocked.

Avahi should use onl *.local or it can be configured otherwise in /etc/avahi/avahi-daemon.conf. Avahi was always too weird for my taste so I do not use it.
Perhaps your router may have something to do with it.
Or your computer is remembering old hostnames and tests them with .lan .local. You may have to clear dns cache of your computer if you test the connection.

That is good news, that I didn’t know… Later I will try to see the configuration file of the computers.