Last week I found myself planning a migration of customers between mail filtering platforms. Part of this change involves changing the MX records for circa 270 domain names.
This posed the question, how on earth are we going to find out who hosts the DNS for these…?
Now I know this could be achieved with nslookup or various other tools out there, but as I am a firm advocate for automation, I thought I’d script this with PHP and share some of the code as well as hosting a live version for you to use.
So for anyone just looking to get on here is the link… http://ip.iis9.co.uk/ns_entry.php
This will return the nameservers for a given list of domain names (one per line).
There is only one catch, some DNS providers do not like you requesting all DNS records and will refuse to return any records at all. However in my experience this happens very infrequently and those can be mopped up with other methods such as nslookup etc.
The interface demonstrates very simple usage of the Bootstrap framework which is great for creating a nice looking UI with very little effort as well as Jquery to handle the AJAX request for actually returning the results.
As for the code, in case you wanted to host this yourself, feel free to download the source here.