What is mDNS used for in Kubo?

From what I understand, mDNS is used for peer discovery on local networks. However, I couldn’t really understand the exact mechanics of this.

Is mDNS only used to discover other libp2p/IPFS peers in the local/private network?

The only configuration I could find was the following:

Yes, it is specific to local network, allows your node to find peers even when WAN or Bootstrappers are not available.

Specs are in specs/mdns.md at master · libp2p/specs · GitHub,
pretty short, mostly based on preexisting RFCs linked there.

Fun fact: older version of this protocol (no longer used) sent non-ascii characters in mDNS messages, which hit a bug in firmware of some Canon printers and rebooted them remotely :))