My general question is how does "dig any" work?
In particular, I would like to compare the use of dig to naive sending of multiple equivalent requests (a, txt, mx, ...).
Does a single DNS query is sent? Is the use of dig more efficient?
Is it guaranteed to get the same results as sending multiple equivalent requests (a, txt, mx, ...)?
If they are not equivalent, when should I use each of the methods?
And finally, if somebody has Python (prefered Python3) implementation of dig (not by running it using subprocess etc.) - I will be glad to get a reference.
An ANY
query is a perfectly ordinary query that asks for the record type with number 255, which is usually referred to as the ANY
type, for fairly obvious reasons. It doesn't matter which tool sends the query (the program dig
, or code you write, or something else), it's the same query anyway.
There is no guarantee that an ANY
query will give the same results as multiple queries for many different types, it's entirely up to the server that generates the responses.
Other than for debugging and diagnostics, there is hardly ever a reason to send an ANY
query.
There are loads of DNS libs for Python. I'm sure someone else can tell you which one is the preferred one these days.