Skip to content

Comment on Ask HN: Intermittent EC2 DNS failures at 1 minute past the hour

Comments

jikOP

Here's the script I'm running from cron both inside AWS and outside it at one minute past the hour (with our internal DNS domain replaced with example.com):

  #!/bin/bash

  tf=/tmp/out.$$

  for turn in $(yes | head -60); do
      start=$(date)
      if ! host $(uuidgen).example.com 2>&1 | tee $tf | grep -q -s -w NXDOMAIN
      then
          end=$(date)
          echo "$cmd failed from $start to $end:"
          cat $tf
      fi
      sleep 1
  done

  rm -f $tf
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.