-
-
Save bnoordhuis/5ebbafe376f05ea6bf1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/dns_uv.js b/lib/dns_uv.js | |
index cc6a1b5..5208741 100644 | |
--- a/lib/dns_uv.js | |
+++ b/lib/dns_uv.js | |
@@ -117,6 +117,13 @@ exports.lookup = function(domain, family, callback) { | |
return {}; | |
} | |
+ // Hack to avoid resolver confusion on dual-stack systems. | |
+ // This is quite likely not the proper solution... | |
+ if (family === 0 && domain === 'localhost') { | |
+ callback(null, '127.0.0.1', 4); | |
+ return {}; | |
+ } | |
+ | |
var matchedFamily = net.isIP(domain); | |
if (matchedFamily) { | |
callback(null, domain, matchedFamily); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment