简体   繁体   中英

How is DNS lookup performed in nodejs

We are facing a challenge with AWSlambda on node js, where DNS.resolve vs. dns.lookup are giving different results. Where former faulting more than latter. And http.client also fails with almost same frequency. I'm interested in understanding, how http module handles DNS lookup.

http.get() calls lookupAndConnect() in net.js which then calls lookup() in dns.js which then calls cares.getaddrinfo() which is in native code which calls uv_getaddrinfo() which has various platform implementations. Here are links to the windows and unix implementations. The source is all on github for you to analyze.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM