[Sysadmins] anyone have a ready written script that.....

Alan Doherty alan at alandoherty.net
Tue Feb 2 00:19:14 GMT 2010


can check if a DNS zone is hosted on a particular ip

ie checks the tld servers for "delegated servers" {and builds these into a list of ip's}

if the ip in question is on that list returns true

if not connects to one of the "delagated NS's" and retrieves the NS from the zone file {and builds these into a list of ip's}

if the ip in question is on that list returns true else returns false

{the second stage is needed because some registrars gui's allow only 2-3 NS's in glue yet some of the domains I slave have many more NS's in their zone file and just "glue" the 2-3 best performing/most distanced servers}

i think it wouldn't take long to script but wondering has someone already done it

{idea is for a once a day cron job against all slaved domains, in case they cancel/move/switch/rehost {or have their domain stolen} and never have the courtesy to let me know, 
{most of the slaved domains are friends or friends of friends, and often their old masters continue to allow axfr {of the now outdated zone file} after switching all dns servers}
happens a lot I have found, and of course if they change MX hosts around the same time breaks any mail my users may have been sending them}

if axfr drops its apparent from logs but the switch when prior master isn't informed is most worrying, now I've seen it happen

it wouldn't need to/want to auto-prune just mail me and let me know their may be an issue or the user may have broken something accidentally




More information about the Sysadmins mailing list