There was no staged phase over, it's MX record was this one minute and that the next. However, it sometimes takes days for DNS changes to filter across the globe and we were with out email correspondence until the new MX record was in use on our DNS servers.
I needed a quick way to wipe this record from each server so that emails could flow freely from my company to theirs. Which is why I created this script; by using the dnscmd line and a few questions it compiles the 51 lines I needed to wipe a record from each of the DNS servers.
@ECHO OFF
ECHO.
ECHO Clear individual entry from Windows Domain DNS servers.
ECHO Top Tips from www.vMowfo.co.uk
ECHO.
SET /P A=Enter the DNS record name (www.google.com):
SET /P B=Record type (A, MX, etc):
SET /P C=Incorrect IP:
dnscmd SERVERNAME /recorddelete /cache "%A%" "%B%" "%C%" /f
It starts of with the ubiquitary information text. Then goes into the 3 questions; DNS name, record type & IP in question. These are the 3 variables for the dnscmd /recorddelete command.
A quick example of the script in action. We have a DNS entry we need, which just happens to be www.vmowfo.co.uk.
This is the script running. As you can see I've entered www.vmowfo.co.uk as the DNS name, A as the record type and it's IP.
Voila, the record has gone. To make the whole thing worth while I need to do it to all the 51 DNS servers. To get a list of your Windows DNS servers, type this at the prompt:
nltest /dclist:FQDN
Where FQDN is your internal domain name. A few quick data organisation tricks in Excel soon produced this as the new batch command file:
