When I configure a
hostname on a computer, that I can look up like this:
and then ping, or ssh from another computer on the same LAN:
$ ssh example
Where is my other computer looking up the address for this hostname? Does the former computer register it with the router somehow? Does the second computer just ask every ip address on the LAN "Are you
The second computer seems to know the ip address that corresponds to
example even if I unplug
example. Is that info cached in the second computer? Or does
hostnamectl somehow register this host name with the router.
And if I plug these computers into another network now, will they still be able to find one another with these hostnames?
How does it all work?