Q30: Why can dns.lookup be blocking in Node.js?

dns.lookup uses the underlying operating system getaddrinfo(3) function synchronously on Libuv thread pool workers, whereas dns.resolve makes network calls asynchronously without thread pool workers.

Key Takeaways
  • dns.lookup uses system resolver calls on Libuv threads.
  • dns.resolve bypasses system files (/etc/hosts) making network queries directly.
Knowledge Check

Which DNS module function directly performs DNS queries over the network without Libuv thread pool workers?