The behavior of dig +short
is to return nothing (null) when running a query that returns no answer (nothing to do with the timeout, just a definite null answer).
It is ok when running a query by itself, but when combining with an -f parameter and running a batch of queries, it is terrible!
dig +short -f queries.txt
queries.txt:
A somedomain.com
TXT otherdomain.com
A somedomain.com
Now, if the DNS server returns nothing for TXT otherdomain.com (i.e., ANSWER: 0), not timeout or something else, then the output of the above dig command will be something like:
dig +short -f queries.txt
1.2.3.4
1.2.3.4
i.e., only two lines. Not suitable for "paste" and other similar commands. You can no longer merge the output of queries.txt and the production output of dig.
Anything elegant can be done here?