With years, I accumulated devices on my local network, which in general run on Linux. I meticulously added them to my /etc/hosts/ file, so as not to remember their IP. Something puzzled me, though: my Synology NAS was readily available as nas.local on the network, without doing anything. I have close to zero skills in system administration, so here are my findings.
The .local domain
We can learn more about .local domain from Wikipedia.
The domain name .local is a special-use domain name reserved by the Internet Engineering Task Force (IETF) so that it may not be installed as a top-level domain in the Domain Name System (DNS) of the Internet. As such it is similar to the other special domain names, such as .localhost. However, .local has since been designated for use in link-local networking, in applications of multicast DNS (mDNS) and zero-configuration networking (zeroconf) so that DNS service may be established without local installations of conventional DNS infrastructure on local area networks.
--
In short, when you send a request to a .local domain, you sent it to a special multicast IP–224.0.0.251. Devices can join the multicast group associated to this IP. From this point on, the router forwards the request to all devices in the group.The one with the corresponding host will respond, others will ignore it.
Here's the result of pinging the above IP on my local network:
PING 224.0.0.251 (224.0.0.251): 56 data bytes
64 bytes from 192.168.1.73: icmp_seq=0 ttl=64 time=0.251 ms
64 bytes from 224.0.0.251: icmp_seq=0 ttl=255 time=13.876 ms
64 bytes from 192.168.1.36: icmp_seq=0 ttl=64 time=127.181 ms
64 bytes from 192.168.1.71: icmp_seq=0 ttl=64 time=128.267 ms
64 bytes from 192.168.1.80: icmp_seq=0 ttl=64 time=128.588 ms
Notice that I get responses from other IPs.
With this approach, local networks can avoid the burden of setting up an internal DNS and the configuration that goes with it on each device.
Setting up a .local domain
For my own local network, I prefer the .local domain to a full-fledged DNS and configuring every device. As I mentioned above, my Synology NAS does it automatically.
Let's set it up for my Raspberry Pi. It works for any Linux-based distribution. I'll use
SOCIAL SHARE CARD GENERATOR