-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Networking & Observability
-
ALL
-
Programmability 2026-02-02, Programmability 2026-03-02
-
None
-
None
-
None
-
None
-
None
-
None
-
None
There is no longer a supported way to parse TXT and SRV records using glibc.
The ns_rr etc functions in libresolv are obsolete and deprecated. We're relying on them despite them not having man pages. glibc maintainer Ulrich Drepper has been outspoken for 20 years that these are not public APIs. Yet we're using them in util/dns_query.cpp.
Having our own custom code for this is exposing us to bugs.
Example: We are handling errors incorrectly, querying errno when h_errno is where the error code is, and the h_errno codes are not printable with strerror. You need the obsolete function hstrerror to print them.
(deprecated: https://man7.org/linux/man-pages/man3/hstrerror.3.html )
We also have a completely different implementation of this for Windows, which DOES have a DnsQuery function. But we shouldn't have to own two separate implementations of the same thing in our application code if we can avoid it.
Note that this is not explicitly about looking up host info or addrinfo. For those we could be using the modern library calls like `getaddrinfo` or `getnameinfo`, and `gai_strerror`. But this is about direct DNS protocol communication, which is the only way to access specialty data like SRV and TXT DNS records.
By chance, we have already vendored the most supported C library for doing this, C-Ares, because it is a transitive dependency of GRPC.
We can probably offload all of this to C-Ares as we'd have a single abstraction supporting windows as well.
- depends on
-
SERVER-120021 upgrade c-ares to >= v1.34.0
-
- Open
-