From 9be6470b534a9da0c93878fa87e6f9574a57acaf Mon Sep 17 00:00:00 2001 From: Alexis Campailla Date: Wed, 18 Dec 2013 10:08:33 -0800 Subject: [PATCH] windows: fix dns lookup of localhost with ipv6 Removing a hack intended to shortcut the resolution of 'localhost' but which doesn't work for ipv6. This was introduced in 2876141c4292791bc12c0b8701dbcc366dde7297. However it seems that the problems that this was trying to circumvent has gone away ages ago, when dns resolution on Windows started relying on Win32 GetAddrInfoW, which was probably with be2320d408de89054b254a0c812280054d946490. Fixes test-net-connect-options-ipv6.js on Windows. --- lib/dns.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/dns.js b/lib/dns.js index 04cf013..34545e8 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -120,15 +120,6 @@ exports.lookup = function(hostname, family, callback) { return {}; } - // Hack required for Windows because Win7 removed the - // localhost entry from c:\WINDOWS\system32\drivers\etc\hosts - // See http://daniel.haxx.se/blog/2011/02/21/localhost-hack-on-windows/ - // TODO Remove this once c-ares handles this problem. - if (process.platform == 'win32' && hostname == 'localhost') { - callback(null, '127.0.0.1', 4); - return {}; - } - var matchedFamily = net.isIP(hostname); if (matchedFamily) { callback(null, hostname, matchedFamily); -- 2.7.4