I am working on switching the nameserves of my domain to a new DNS service. What is the best tool to compare the new settings with the existing DNS setup.
I have tried to use dig with and without @nameserver to allow me to make sure that the DNS records match between the old and the new provider.
No success so far.
Any ideas ?
This script was made to compare two zone files during a migration.
It uses colour coding and a final status output to indicate what records are different
SOA and NS records will be different during a migration - just note the differences
ANY record will probably be different too as it includes above types in it.
A MX and TXT records should be the same , if they exist - difference here means a problem !
Source: https://github.com/geek4unix/compare-zones/
I answer that old question, I was confronted with this problem and I solved it this way:
For a single domain:
diff <(sort -u <(dig +nottlid +noall +answer @ns.myfirstserver.com example.com ANY) ) <(sort -u <(dig +nottlid +noall +answer @ns.mysecondserver.com example.com ANY) )
For multiple domains or subdomains:
The command line:
diff <(sort -u <(for host in $(cat alldomains.txt); do dig +nottlid +noall +answer @ns.myfirstserver.com $host ANY; done) ) <(sort -u <(for host in $(cat alldomains.txt); do dig +nottlid +noall +answer @ns.mysecondserver.com $host ANY; done) )
Comments:
You can redirect to a file by adding > myresult.txt
at end.
I hope this can help someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With