sindresorhus/is-online — pull request #5 by silverwind (2014-09-24 17:42:35+00:00)
Title: Root DNS and socket checks

As discussed in #4, here's my PR.

The check first does a query to a random root server for the authorative information for the .com zone. If that checks returns an indecisive result, the provided `domains` are checked through a tcp connect on port 80. If this succeeds for one domain, the callback returns `true`, if all provided domains fail to connect, returns `false`.

The prime reason this provides more reliabilty is in networks with an local dns server which may cache popular names like `google.com`, making the original dns mechanism unreliable.