Skip to content

Favor dns_sd DNSServiceGetAddrInfo on linux as well #250

@tadam313

Description

@tadam313

I'm wondering whether we should prefer to use the dns_sd DNSServiceGetAddrInfo function (HAVE_DNSSERVICEGETADDRINFO flag) over the node implementation (cares_wrap) on linux-ish systems as well if available. I know that "avahi compat" library does not have this function, however, we can still compile Apple's mDNSResponder Posix version on certain linux distros which does have it. I have a use-case on Synology DSM (which is recognized as "Linux" by node gyp) where I had to use Apple's library (avahi is not available) and need to force using DNSServiceGetAddrInfo (by manually defining HAVE_DNSSERVICEGETADDRINFO in binding.gyp). Unfortunately, the node implementation did not work, I was constantly getting errors like { code: -3008, errno: -3008, syscall: 'getaddrinfo' }. However dns_sd implementation works perfectly fine.

This makes me wondering should we define HAVE_DNSSERVICEGETADDRINFO based on capability on Linux? For now, it's completely missing and assumed that linux systems use avahi library every time. For example, we could use nm to check whether DNSServiceGetAddrInfo is available in libdns_sd.so or not? WDYT?

The alternative would be to target Synology DSM OS exclusively with some condition and define this flag there, but not sure at the time how could we do it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions