I've pored over the man pages and I'm pretty sure the answer is "no" but is there a way to prevent dig from resolving a CNAME record for a host?
For example:
$ dig +short mail.yahoo.com A
edge.gycpi.b.yahoodns.net.
66.218.84.40
66.218.84.44
66.218.84.41
66.218.84.45
66.218.84.42
66.218.84.43
There is not an A record for this host, so I should get no answer. It seems like A and AAAA are treated differently from any other record type in this regard.
I've tried the +norecurse and +noadditional options without success. I can easily parse the response in my script to see if it has multiple lines where the first one is a FQDN, but it feels like I shouldn't have to.
digdoesn't indeed have anything to filter it out. You could trysystemd-resolve -4 mail.yahoo.com