Skip to content

Instantly share code, notes, and snippets.

View gabrielf's full-sized avatar

Gabriel Falkenberg gabrielf

View GitHub Profile

This script will use the dns.lookup function, which is used by node internally when making http requests, to lookup an IP and a hostname 3 times. A healthy system should give output similar to:

lookup of 93.184.216.119: 0ms
lookup of 93.184.216.119: 0ms
lookup of 93.184.216.119: 0ms
lookup of example.com: 6ms
lookup of example.com: 1ms
lookup of example.com: 0ms

Note that the first hostname lookup took longer than the following because of caching in some DNS. An unhealthy system might give you output like this: