node.jsでのタイムアウト検知可能なnslookupの実装

最近、AWS Lambdaを使って、月額0円なサーバ監視を試しています。

node.js初心者な私は、dns.resolvとsetTimeoutの組み合わせでのDNSサーバ監視がうまく出来ていません。タイムアウト検知の挙動が思わしくないため、ダウンサーバが多いとamazonに『時間切れ』と怒られてしまいます。

そんな時にnslookupの実装を見付けて幸せになれましたので、ご紹介しておきます。
https://github.com/alsotang/nslookup/blob/master/lib/nslookup.js

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny