A number of years ago I wrote code that uses dns_open(...) and dns_lookup(...) to call a remote name server for dns resolution.
Testing in Monterey, Big Sur and Catalina I get a NULL reply from dns_lookup. The code produces an expected result with Mojave and High Sierra.
If I pass NULL as the argument to dns_open() then resolution is successful, but that is not using the desired name server.
I have submitted feedback request FB10027085 with a small project that demonstrates the failure.