<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>We’re using this in a bash shell script.  I don’t think there’s a native shell command to get the IP, so I’ll use a mixture of host and dig as necessary.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Frank<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Fajar A. Nugraha [mailto:work@fajar.net] <br><b>Sent:</b> Sunday, October 19, 2014 11:04 PM<br><b>To:</b> Frank Bulk<br><b>Cc:</b> comp-protocols-dns-bind@isc.org<br><b>Subject:</b> Re: Digging to the final IP<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>What are you using this for?<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>If it's part of a script, it might be easier to just use gethostbyname. For example, in php: <a href="http://php.net/manual/en/function.gethostbyname.php">http://php.net/manual/en/function.gethostbyname.php</a> , Returns the IPv4 address or a string containing the unmodified hostname on failure.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>-- <o:p></o:p></p></div><div><p class=MsoNormal>Fajar<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Mon, Oct 20, 2014 at 10:43 AM, Frank Bulk <<a href="mailto:frnkblk@iname.com" target="_blank">frnkblk@iname.com</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal>Thanks, what I ended up using.<br><br>Didn't think that there was anything host could do that dig couldn't do.<br><span style='color:#888888'><br><span class=hoenzb>Frank</span></span><o:p></o:p></p><div><div><p class=MsoNormal><br>-----Original Message-----<br>From: <a href="mailto:bind-users-bounces@lists.isc.org">bind-users-bounces@lists.isc.org</a><br>[mailto:<a href="mailto:bind-users-bounces@lists.isc.org">bind-users-bounces@lists.isc.org</a>] On Behalf Of Barry Margolin<br>Sent: Sunday, October 19, 2014 5:00 AM<br>To: <a href="mailto:comp-protocols-dns-bind@isc.org">comp-protocols-dns-bind@isc.org</a><br>Subject: Re: Digging to the final IP<br><br>In article <<a href="mailto:mailman.1097.1413711142.26362.bind-users@lists.isc.org">mailman.1097.1413711142.26362.bind-users@lists.isc.org</a>>,<br> Sten Carlsen <<a href="mailto:stenc@s-carlsen.dk">stenc@s-carlsen.dk</a>> wrote:<br><br>> Would "host" be closer to what you want?<br><br>Host also tells you about aliases it encounters along the way.<br><br>><br>><br>> --<br>> Best regards<br>><br>> Sten Carlsen<br>><br>> No improvements come from shouting:<br>><br>>       "MALE BOVINE MANURE!!!"<br>><br>> > On 19 Oct 2014, at 08:05, Karl Auer <<a href="mailto:kauer@biplane.com.au">kauer@biplane.com.au</a>> wrote:<br>> ><br>> >> On Sun, 2014-10-19 at 00:26 -0500, Frank Bulk wrote:<br>> >> Is there a dig option that will list out the final (IPs) or query<br>result??<br>> >> By default, even with +short, it can list intermediate CNAME(s) and not<br><br>> >> what<br>> >> IP(s) that CNAME may have.<br>> ><br>> > Not great, but might be enough to be helpful:<br>> ><br>> >   dig +nonssearch $1 | egrep -i "STATUS|^$1"<br>> ><br>> > Regards, K.<br>> ><br>> > --<br>> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>> > Karl Auer (<a href="mailto:kauer@biplane.com.au">kauer@biplane.com.au</a>)<br>> > <a href="http://www.biplane.com.au/kauer" target="_blank">http://www.biplane.com.au/kauer</a><br>> > <a href="http://twitter.com/kauer389" target="_blank">http://twitter.com/kauer389</a><br>> ><br>> > GPG fingerprint: EC67 61E2 C2F6 EB55 884B E129 072B 0AF0 72AA 9882<br>> > Old fingerprint: B862 FB15 FE96 4961 BC62 1A40 6239 1208 9865 5F9A<br>> ><br>> ><br>> > _______________________________________________<br>> > Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a> to<br>> > unsubscribe from this list<br>> ><br>> > bind-users mailing list<br>> > <a href="mailto:bind-users@lists.isc.org">bind-users@lists.isc.org</a><br>> > <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a><br><br>--<br>Barry Margolin<br>Arlington, MA<br>_______________________________________________<br>Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a> to<br>unsubscribe from this list<br><br>bind-users mailing list<br><a href="mailto:bind-users@lists.isc.org">bind-users@lists.isc.org</a><br><a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a><br><br><br>_______________________________________________<br>Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a> to unsubscribe from this list<br><br>bind-users mailing list<br><a href="mailto:bind-users@lists.isc.org">bind-users@lists.isc.org</a><br><a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a><o:p></o:p></p></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>