mDNS via systemd-resolved
Linux machines where Avahi is not installed, or systemd-resolved is configured to be a DNS resolver, microdns and Avahi cannot be used to lookup mDNS records.
Systemd-resolved provides a DBus API to do dns lookups, and the query can be limited specifically to mDNS lookups for service discovery: https://www.freedesktop.org/software/systemd/man/org.freedesktop.resolve1.html
Alternatively, it's also possible to perform mDNS lookups using the normal DNS lookup API on posix systems, so long as systemd-resolved is the DNS lookup provider, and is configured to do so. I have details on how this is done here: https://tracker.ceph.com/issues/50869