Another alternative, if you're simply looking for ASN/CIDR information, is to use the routeviews project.<div><br></div><div>host -t txt <a href="http://51.51.51.51.asn.routeviews.org">51.51.51.51.asn.routeviews.org</a> </div>
<div><br></div><div>... returns the ASN and CIDR block of the IP in question.</div><div><br>Note that as usual, this is reversed dotted quad, so if your original IP is 1.2.3.4, you're querying <a href="http://4.3.2.1.asn.routeviews.org">4.3.2.1.asn.routeviews.org</a></div>
<div><br></div><div>More information on the routeviews project: <a href="http://www.routeviews.org/">http://www.routeviews.org/</a></div><div><br></div><div>If you want information on the ASN, you can still query WHOIS.   Or you can hit the CIDR Report:</div>
<div><br></div><div><a href="http://www.cidr-report.org">http://www.cidr-report.org</a></div><div><br>Example:</div><div><br></div><div><div>$ host <a href="http://www.cidr-report.org">www.cidr-report.org</a></div><div><a href="http://www.cidr-report.org">www.cidr-report.org</a> has address 203.133.248.2</div>
<div><br></div><div>$ host -t txt <a href="http://2.248.133.203.asn.routeviews.org">2.248.133.203.asn.routeviews.org</a> </div><div><a href="http://2.248.133.203.asn.routeviews.org">2.248.133.203.asn.routeviews.org</a> descriptive text "4608" "203.133.248.0" "24"</div>
<div><br></div><div><div>karsten@zharben:~$ host -t txt <a href="http://51.51.51.51.asn.routeviews.org">51.51.51.51.asn.routeviews.org</a></div><div><a href="http://51.51.51.51.asn.routeviews.org">51.51.51.51.asn.routeviews.org</a> descriptive text "4294967295" "0" "0"</div>
<div>karsten@zharben:~$ host <a href="http://www.cidr-report.org">www.cidr-report.org</a></div><div><a href="http://www.cidr-report.org">www.cidr-report.org</a> has address 203.133.248.2</div><div>karsten@zharben:~$ host -t text <a href="http://2.248.133.103.asn.routeviews.org">2.248.133.103.asn.routeviews.org</a> </div>
<div>host: invalid type: text</div><div><br></div><div>karsten@zharben:~$ host -t txt <a href="http://2.248.133.103.asn.routeviews.org">2.248.133.103.asn.routeviews.org</a> </div><div>Host <a href="http://2.248.133.103.asn.routeviews.org">2.248.133.103.asn.routeviews.org</a> not found: 3(NXDOMAIN)</div>
<div>karsten@zharben:~$ host -t txt <a href="http://2.248.133.203.asn.routeviews.org">2.248.133.203.asn.routeviews.org</a> </div><div><a href="http://2.248.133.203.asn.routeviews.org">2.248.133.203.asn.routeviews.org</a> descriptive text "4608" "203.133.248.0" "24"</div>
<div>karsten@zharben:~$ whois n 4608</div><div>No whois server is known for this kind of object.</div><div>karsten@zharben:~$ whois n!4608</div><div>bash: !4608: event not found</div><div>karsten@zharben:~$ whois AS4608</div>
<div>% [<a href="http://whois.apnic.net">whois.apnic.net</a> node-5]</div><div>% Whois data copyright terms    <a href="http://www.apnic.net/db/dbcopyright.html">http://www.apnic.net/db/dbcopyright.html</a></div><div><br>
</div><div>as-block:     AS4608 - AS4864</div><div>descr:        APNIC ASN block</div><div>remarks:      These AS numbers are further assigned by APNIC</div><div>remarks:      to APNIC members and end-users in the APNIC region</div>
<div>admin-c:      HM20-AP</div><div>tech-c:       HM20-AP</div><div>mnt-by:       APNIC-HM</div><div>mnt-lower:    APNIC-HM</div><div>changed:      <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20020926</div>
<div>changed:      <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20030207</div><div>changed:      <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20050309</div><div>source:       APNIC</div>
<div><br></div><div>aut-num:        AS4608</div><div>as-name:        APNIC-AP</div><div>descr:          Asia Pacific Network Information Centre</div><div>descr:          Regional Internet Registry for the Asia-Pacific Region</div>
<div>descr:          6 Cordelia Street</div><div>descr:          PO Box 3646</div><div>descr:          South Brisbane, QLD 4101</div><div>descr:          Australia</div><div>country:        AU</div><div>admin-c:        HM20-AP</div>
<div>tech-c:         NO4-AP</div><div>notify:         <a href="mailto:noc@apnic.net">noc@apnic.net</a></div><div>mnt-by:         MAINT-APNIC-AP</div><div>mnt-irt:        IRT-APNIC-AP</div><div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a></div>
<div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20110309</div><div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20110815</div><div>source:         APNIC</div>
<div><br></div><div>role:           APNIC Hostmaster</div><div>address:        6 Cordelia Street</div><div>address:        South Brisbane</div><div>address:        QLD 4101</div><div>country:        AU</div><div>phone:          +61 7 3858 3100</div>
<div>fax-no:         +61 7 3858 3199</div><div>e-mail:         <a href="mailto:helpdesk@apnic.net">helpdesk@apnic.net</a></div><div>admin-c:        AMS11-AP</div><div>tech-c:         AH256-AP</div><div>nic-hdl:        HM20-AP</div>
<div>remarks:        Administrator for APNIC</div><div>notify:         <a href="mailto:noc@apnic.net">noc@apnic.net</a></div><div>mnt-by:         MAINT-APNIC-AP</div><div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 19981111</div>
<div>changed:        <a href="mailto:dbmon@apnic.net">dbmon@apnic.net</a> 19990702</div><div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20020211</div><div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20070612</div>
<div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20100217</div><div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20101217</div><div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20110815</div>
<div>source:         APNIC</div><div><br></div><div>person:         APNIC Network Operations</div><div>address:        6 Cordelia Street</div><div>address:        South Brisbane</div><div>address:        QLD 4101</div><div>
country:        AU</div><div>phone:          +61 7 3858 3100</div><div>fax-no:         +61 7 3858 3199</div><div>e-mail:         <a href="mailto:netops@apnic.net">netops@apnic.net</a></div><div>nic-hdl:        NO4-AP</div>
<div>remarks:        Administrator for APNIC Network Operations</div><div>notify:         <a href="mailto:netops@apnic.net">netops@apnic.net</a></div><div>mnt-by:         MAINT-APNIC-AP</div><div>changed:        <a href="mailto:netops@apnic.net">netops@apnic.net</a> 19981111</div>
<div>changed:        <a href="mailto:hostmaster@apnic.net">hostmaster@apnic.net</a> 20020211</div><div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20081205</div><div>changed:        <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20101217</div>
<div>source:         APNIC</div><div><br></div><div><br></div><div>$ whois AS4608 </div><div>% [<a href="http://whois.apnic.net">whois.apnic.net</a> node-1]</div><div>% Whois data copyright terms    <a href="http://www.apnic.net/db/dbcopyright.html">http://www.apnic.net/db/dbcopyright.html</a></div>
<div><br></div><div>as-block:     AS4608 - AS4864</div><div>descr:        APNIC ASN block</div><div>remarks:      These AS numbers are further assigned by APNIC</div><div>remarks:      to APNIC members and end-users in the APNIC region</div>
<div>admin-c:      HM20-AP</div><div>tech-c:       HM20-AP</div><div>mnt-by:       APNIC-HM</div><div>mnt-lower:    APNIC-HM</div><div>changed:      <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20020926</div>
<div>changed:      <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20030207</div><div>changed:      <a href="mailto:hm-changed@apnic.net">hm-changed@apnic.net</a> 20050309</div><div>source:       APNIC</div>
</div><div> <etc.></div><br><div class="gmail_quote">On Sat, Sep 10, 2011 at 7:26 AM, Always Learning <span dir="ltr"><<a href="mailto:centos@u61.u22.net">centos@u61.u22.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
This works for me on Centos 5.6. It may assist newcomers to the Linux<br>
world of Centos.<br>
<br>
        whois 51.51.51.51<br>
<br>
produces a normal and conventional display of data.<br>
<br>
However since ARIN, the North American registrar of IP addresses,<br>
"modernised" its WHOIS processing, a query to<br>
<br>
        whois 64.64.64.64<br>
<br>
will produce a one line summary of possible matches, which always<br>
includes ARIN, but omits the details we used to receive before ARIN<br>
implemented its much criticised "improved" service.<br>
<br>
A one line script solves it for me (but only for ARIN network entries).<br>
<br>
        #!/bin/bash<br>
        whois -h <a href="http://whois.arin.net" target="_blank">whois.arin.net</a> n + $1<br>
<br>
I call my script .arin<br>
<br>
        .arin 64.64.64.64<br>
<br>
produces a normal output.<br>
<br>
<br>
<br>
Paul.<br>
<br>
_______________________________________________<br>
CentOS mailing list<br>
<a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
<a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Dr. Ed Morbius<br>Chief Scientist / Philologist / Robot Wrangler / Powerplant Operator<br>Krell Power Systems Unlimited<br><br>
</div>