#!/bin/sh # [4.2.2] cronjob - DNS axfr based [host] # This is one of many scripts you could use to accomplish this task. It # requires that your cron server have AXFR privileges on your DNS servers. # You could also use `host -l` instead of `host -t axfr` which will allow # you to remove the three `grep -v` commands as well as the `sed` at the # end. Only problem with `host -l` is that it will not pick up CNAME # records, only A. DOMAINS="unixdev.net colo.netizenweb.com bama.netizenweb.com netizenweb.com iridiumnetworks.net" PREHOSTS="$HOME/.tcsh/hosts-pre" HOSTS="$HOME/.tcsh/hosts" (cat $PREHOSTS for each in $DOMAINS; do host -t axfr $each | grep -v ';' | grep -v Trying | grep -v Received | awk '{print $1}' | sed 's/\.$//' # host -l $each | awk '{print $1}' ## when uncommented, comment above done ) | sort | uniq > $HOSTS