Multiple responses from drill, dig, or other tools?

A domain’s DNS may include multiple records of the same type, eg A, CNAME, TXT.
The traditional dig -t TXT will only return the first record.
How to persuade one or other of such tools to return ALL the records of a nominated type?
Please advise =dn

Is the option ANY you are looking for?

dig -t TXT ANY

If you compair with you can see more. I think just not has so much more.

Sadly no - if it worked the way the help said, I wouldn’t have wasted your time, and hence my surprise…

dig -t TXT ANY +short
“v=spf1 ip4: -all”

(same content in full-listing)

Looking at the DNS server, there are many more TXT records - and they are read correctly in their specific contexts. (same for A, MX, and CNAME records)

Looks like dig -t TXT is working as intended, since it returned two results. Are all of your txt records for the top level Or are some like a DKIM txt record, I think to see all of the records like that, you’ll have to do a zone transfer.

dig -t TXT

; <<>> DiG 9.18.8 <<>> -t TXT
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39929
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 65494

;; ANSWER SECTION:	219	IN	TXT	"v=spf1 -all"	219	IN	TXT	"MS=ms24164931"

;; Query time: 0 msec
;; WHEN: Sun Jan 22 21:36:04 EST 2023
;; MSG SIZE  rcvd: 113


Have you tried dig +all? (Untested by me, at work, I usually use +short)

+ALL makes no difference. Isn’t it the default setting?

Thanks. That seems to explain things - www.domain.tld is not returned, nor are the DKIM etc records.

Why are these A or TXT records not returned, ie not considered to be A/TXT records, when they plainly are?

Zone Transfers are a whole new ‘can of worms’!

Regards =dn

Can you provide an example of an A and TXT record not returned when we query A

dig -t a is only going to return A records for It will not return or, etc.

Without getting into zone transfers (which will likely require some config to allow zone transfers for your domain), I don’t think it’s possible for dig to give you records for subdomains.

1 Like