szmarczak / cacheable-lookup

A cacheable dns.lookup(…) that respects TTL :tada:
MIT License
193 stars 29 forks source link

Question: How is DNS resolved? #53

Closed curlyblueeagle closed 2 years ago

curlyblueeagle commented 2 years ago

Sorry if this seems like a basic question, but how does cacheable-lookup resolve DNS? Looking at the code it seems to be using dns.resolve with dns.lookup as a fallback. Am I correct in this assumption?

szmarczak commented 2 years ago

Correct. It uses dns.lookup as a fallback in order to support /etc/hosts.

curlyblueeagle commented 2 years ago

Perfect thank you! This answers my question, so I will close issue.