tjfontaine/node-dns — pull request #1 by daguej (2012-01-26 05:41:51+00:00)
Title: Add rudimentary Windows support

AKA fix it so it doesn't crash as soon as you start up.

Under Windows, /etc/hosts and /etc/resolv.conf obviously don't exist. This patches platform.js so that you can at least get up and running under Windows.

- Looks for the hosts file at %SYSTEMROOT%\System32\drivers\etc\hosts - seems to work
- Getting the system's configured nameservers is a bit trickier. There's a Win32 API available (`GetNetworkParams`), but that means building a native Addon. You could also parse the output of `ipconfig.exe /all`, but that feels ugly. I just faked it for now using Google's public DNS servers.