undici icon indicating copy to clipboard operation
undici copied to clipboard

Feature request: allow a custom dns lookup function to be supplied

Open JakeChampion opened this issue 3 years ago • 3 comments

The http built-in module can have a custom lookup function defined, which is great as it enables applications to decide if they want to implement a dns-caching system or something else.

Do we think it is a good idea to also implement such a feature for undici?

JakeChampion avatar Sep 17 '20 16:09 JakeChampion

Sure, would you like to send a PR?

mcollina avatar Sep 17 '20 17:09 mcollina

Would this be the correct change?

Make these net.connect calls take a custom lookup function and default to dns.lookup otherwise? https://github.com/nodejs/undici/blob/2b56a548083d9bc44f89962459ee6325c38742d5/lib/core/client.js#L871

Are these other places that would need to be updated also?

JakeChampion avatar Sep 17 '20 17:09 JakeChampion

I think this could be resolved through https://github.com/nodejs/undici/issues/852

ronag avatar Jun 29 '21 18:06 ronag