Finding out when your DNS delegation has propogated

Written by James McDonald

May 6, 2009

If you have delegated your DNS to another hosting provider you may want to send yourself an email when your DNS domain delegation has propogated (so you can notify people after the change and not have everyone saying “I can’t get to your site”).

Create a script as follows and then install crontab to run it every X minutes.

The email you receive will have a time stamp to the nearest X minutes.

Create in your home directory
Replace with your domain and with one of your ISP’s DNS server IP addresses. And obviously edit [email protected] to be your own email address.

# edit this to be a substring of the new dns servers you are moving to.
# ie. my new DNS servers are 
# so setting it to will match when the 
# dig query returns the newly propogated server list 
# CHECKTHIS=dyndns
# CHECKTHIS= (you can check for an IP aswell)
dig -t ns @ | \
&& if [ ! -f sent ] ; \
then touch sent ; \
echo Sending ; \
echo DNS has propagated | \
mail -s "DNS Updated" [email protected] ; \

Crontab to run above script every 5 minutes

# m h  dom mon dow   command
*/5 * * * * $HOME/

You obviously need the mail command installed on your box apt-get install mailx and dig aswell apt-get install dnsutils (this is for Ubuntu/Debian)


  1. cwraig

    Nice, i’m going to be moving hosts next weekend for some sites and I will use this for sure.

  2. cello

    I’m not sure how you worked this out, but it’ll sure come in handy!


Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Ubuntu on Hyper-v

It boils town to installing linux-azure # as root or sudo apt-get update apt-get install linux-azure...