I answer this old question, I ran into this problem and I solved it like this:
For one 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:
- Create a text file with 1 domain per line (for example: alldomains.txt)
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:
- diff: compare files line by line
- sort: sort lines of text files
- -u: make sure that there is only a unique string
- dig: DNS lookup utility
- + nottlid: do not display TTL when printing a record
- + noall: clear all display flags
- answer: display the authority section of the response.
- @ ns.server.com: name or IP address of the name server for the request
- ANY: indicates what type of request is required (ANY, A, MX, SIG, etc.).
You can redirect the file by adding > myresult.txt
at the end.
I hope this can help someone.
source share