On Oct 19, 2014, at 1:26, Frank Bulk <frnk...@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@nagios:/tmp# dig mail.automatedwastesystems.net +short
>       mail3.sandhills.com.
>       root@nagios:/tmp#
> 
> I'd rather know that mail3.sandhills.com is NXDOMAIN.
> 
> Regards,
> 
> Frank


How about… 

$ 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
216.235.14.46

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
216.235.14.46
2001:4900:1:393::2

dave

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to