Digging to the final IP
dave at knig.ht
Wed Oct 22 01:20:53 UTC 2014
On Oct 19, 2014, at 1:26, Frank Bulk <frnkblk at iname.com> wrote:
> Is there a dig option that will list out the final (IPs) or query result??
> By default, even with +short, it can list intermediate CNAME(s) and not what
> IP(s) that CNAME may have.
> For example,
> root at nagios:/tmp# dig mail.automatedwastesystems.net +short
> root at nagios:/tmp#
> I'd rather know that mail3.sandhills.com is NXDOMAIN.
$ dig +noall +answer mail.automatedwastesystems.net in a | egrep 'IN\tA\t' | cut -f6
which correctly returns nothing in this case, but when there’s a CNAME chain ending in addresses it returns them
$ dig +noall +answer dave.knig.ht in a | egrep 'IN\tA\t' | cut -f6
and surely you want IPv6 support…
$ dig +noall +answer dave.knig.ht in a dave.knig.ht in aaaa | egrep 'IN\t(A|AAAA)\t' | cut -f6
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
More information about the bind-users