About DNS implementation in got module #2386
-
|
Hi community, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Got uses Node's default DNS resolution which is For DNS caching, yes, you should use the import CacheableLookup from 'cacheable-lookup';
const cacheable = new CacheableLookup();
await got('https://example.com', {
dnsLookup: cacheable.lookup
});This is definately recommended if you're making many requests to the same hosts, as it can significantly improve performance by avoiding redundant DNS lookups. |
Beta Was this translation helpful? Give feedback.
Got uses Node's default DNS resolution which is
dns.lookup()under the hood (via the http/https modules).For DNS caching, yes, you should use the
cacheable-lookuppackage. You can pass it to Got like this:This is definately recommended if you're making many requests to the same hosts, as it can significantly improve performance by avoiding redundant DNS lookups.