nameserver discovery
Closed this issue · 4 comments
One thing that pollen could do is to find nameservers to query based on dns configuration, /etc/resolv.conf
, this way one would not have to pass it manually.
Could also provide it as a utility function
Oh, I thought that dns.resolve4()
used nameservers in /etc/resolv.conf
because the underlying c-ares seems to do so. Have you tested whether it works like that?
In the worst case, we could use dns.lookup()
with all: true
instead of dns.resolve4()
so that we can support /etc/hosts
too. There will be less chance that it will block the libuv thread pool as long as we don't make too many lookups.
There will be less chance that it will block the libuv thread pool as long as we don't make too many lookups.
Btw, I was reading libuv source code the other day, dns request do not seem to block the whole pool.
Only half of uv thread pool is dedicated to slow io (dns), the rest is available for fast io (filesystem) and cpu-heavy tasks.
I thought that
dns.resolve4()
used nameservers in
Ah, you're right, I got confused then. Closing the ticket!
Have you tested whether it works like that?
Nope, I'm just browsing through the source atm
Yes, it has landed on Node 10.12.0 and 8.13.0.