I'm confused about ".local" though. It's reserved for Multicast DNS? [2]
[1]: https://www.iana.org/assignments/special-use-domain-names/sp...
$ dig -p 5353 raspberrypi.local @224.0.0.251
; <<>> DiG 9.8.3-P1 <<>> -p 5353 raspberrypi.local @224.0.0.251
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21640
;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;raspberrypi.local. IN A
;; ANSWER SECTION:
raspberrypi.local. 10 IN A 192.168.1.175
A DNS query packet is to the multicast address 224.0.0.251 and UDP port 5353. All devices on your network that are listening on that address will see the query (e.g. Linux systems with avahi-daemon or Macs running mDNSResponder). The device whose name is raspberryi will respond. RFC6762 should have all the details.(It's useful as a development tool as you can Virtual Host project1.localhost and project2.localhost to different in development sites if your OS and server support it, which tend to be in similar ways to how they generally support Virtual Hosts.)
6.3. Domain Name Reservation Considerations for "localhost."
The domain "localhost." and any names falling within ".localhost."
are special in the following ways:
1. Users are free to use localhost names as they would any other
domain names. Users may assume that IPv4 and IPv6 address
queries for localhost names will always resolve to the respective
IP loopback address.
[...] 3. Name resolution APIs and libraries SHOULD recognize localhost
names as special and SHOULD always return the IP loopback address
for address queries and negative responses for all other query
types. Name resolution APIs SHOULD NOT send queries for
localhost names to their configured caching DNS server(s).
And goes on to specify how resolvers, authoratitive DNS servers, registrars, etc. should behave.This is implemented on my machine at least by systemd_resolved, see https://github.com/systemd/systemd/blob/master/src/resolve/r... which returns ::1/127.0.0.1 for any record for which which is_localhost is true (defined in https://github.com/systemd/systemd/blob/master/src/basic/hos...).
I hope ...