Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
`dns.resolve` fails when the io/node process starts without an active network connection #1644
If the process starts before the Internet connection is disabled, it will work as expected once the connection is re-enabled.
For what it's worth, this bug doesn't affect
I speculate that's because c-ares (the C library that powers dns.resolve()) reads /etc/resolv.conf once at start-up. If you start iojs when the network is disabled, /etc/resolv.conf is going to be empty.
I'm not sure if it's fixable. iojs doesn't know when the network comes back up and even if it did, it may not be trivial to reinitialize c-ares.
It can be used to automatically monitor
var resolvmon = require('resolvmon'); resolvmon.start(); // start monitoring resolvmon.update(); // trigger manual update
Some features of
Obviously this does not replace full