Another alternative, if you're simply looking for ASN/CIDR information, is to use the routeviews project.

host -t txt 51.51.51.51.asn.routeviews.org 

... returns the ASN and CIDR block of the IP in question.

Note that as usual, this is reversed dotted quad, so if your original IP is 1.2.3.4, you're querying 4.3.2.1.asn.routeviews.org

More information on the routeviews project: http://www.routeviews.org/

If you want information on the ASN, you can still query WHOIS.   Or you can hit the CIDR Report:

http://www.cidr-report.org

Example:

$ host www.cidr-report.org
www.cidr-report.org has address 203.133.248.2

$ host -t txt 2.248.133.203.asn.routeviews.org 
2.248.133.203.asn.routeviews.org descriptive text "4608" "203.133.248.0" "24"

karsten@zharben:~$ host -t txt 51.51.51.51.asn.routeviews.org
51.51.51.51.asn.routeviews.org descriptive text "4294967295" "0" "0"
karsten@zharben:~$ host www.cidr-report.org
www.cidr-report.org has address 203.133.248.2
karsten@zharben:~$ host -t text 2.248.133.103.asn.routeviews.org 
host: invalid type: text

karsten@zharben:~$ host -t txt 2.248.133.103.asn.routeviews.org 
Host 2.248.133.103.asn.routeviews.org not found: 3(NXDOMAIN)
karsten@zharben:~$ host -t txt 2.248.133.203.asn.routeviews.org 
2.248.133.203.asn.routeviews.org descriptive text "4608" "203.133.248.0" "24"
karsten@zharben:~$ whois n 4608
No whois server is known for this kind of object.
karsten@zharben:~$ whois n!4608
bash: !4608: event not found
karsten@zharben:~$ whois AS4608
% [whois.apnic.net node-5]
% Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html

as-block:     AS4608 - AS4864
descr:        APNIC ASN block
remarks:      These AS numbers are further assigned by APNIC
remarks:      to APNIC members and end-users in the APNIC region
admin-c:      HM20-AP
tech-c:       HM20-AP
mnt-by:       APNIC-HM
mnt-lower:    APNIC-HM
changed:      hm-changed@apnic.net 20020926
changed:      hm-changed@apnic.net 20030207
changed:      hm-changed@apnic.net 20050309
source:       APNIC

aut-num:        AS4608
as-name:        APNIC-AP
descr:          Asia Pacific Network Information Centre
descr:          Regional Internet Registry for the Asia-Pacific Region
descr:          6 Cordelia Street
descr:          PO Box 3646
descr:          South Brisbane, QLD 4101
descr:          Australia
country:        AU
admin-c:        HM20-AP
tech-c:         NO4-AP
notify:         noc@apnic.net
mnt-by:         MAINT-APNIC-AP
mnt-irt:        IRT-APNIC-AP
changed:        hm-changed@apnic.net
changed:        hm-changed@apnic.net 20110309
changed:        hm-changed@apnic.net 20110815
source:         APNIC

role:           APNIC Hostmaster
address:        6 Cordelia Street
address:        South Brisbane
address:        QLD 4101
country:        AU
phone:          +61 7 3858 3100
fax-no:         +61 7 3858 3199
e-mail:         helpdesk@apnic.net
admin-c:        AMS11-AP
tech-c:         AH256-AP
nic-hdl:        HM20-AP
remarks:        Administrator for APNIC
notify:         noc@apnic.net
mnt-by:         MAINT-APNIC-AP
changed:        hm-changed@apnic.net 19981111
changed:        dbmon@apnic.net 19990702
changed:        hm-changed@apnic.net 20020211
changed:        hm-changed@apnic.net 20070612
changed:        hm-changed@apnic.net 20100217
changed:        hm-changed@apnic.net 20101217
changed:        hm-changed@apnic.net 20110815
source:         APNIC

person:         APNIC Network Operations
address:        6 Cordelia Street
address:        South Brisbane
address:        QLD 4101
country:        AU
phone:          +61 7 3858 3100
fax-no:         +61 7 3858 3199
e-mail:         netops@apnic.net
nic-hdl:        NO4-AP
remarks:        Administrator for APNIC Network Operations
notify:         netops@apnic.net
mnt-by:         MAINT-APNIC-AP
changed:        netops@apnic.net 19981111
changed:        hostmaster@apnic.net 20020211
changed:        hm-changed@apnic.net 20081205
changed:        hm-changed@apnic.net 20101217
source:         APNIC


$ whois AS4608 
% [whois.apnic.net node-1]
% Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html

as-block:     AS4608 - AS4864
descr:        APNIC ASN block
remarks:      These AS numbers are further assigned by APNIC
remarks:      to APNIC members and end-users in the APNIC region
admin-c:      HM20-AP
tech-c:       HM20-AP
mnt-by:       APNIC-HM
mnt-lower:    APNIC-HM
changed:      hm-changed@apnic.net 20020926
changed:      hm-changed@apnic.net 20030207
changed:      hm-changed@apnic.net 20050309
source:       APNIC
 <etc.>

On Sat, Sep 10, 2011 at 7:26 AM, Always Learning <centos@u61.u22.net> wrote:
This works for me on Centos 5.6. It may assist newcomers to the Linux
world of Centos.

       whois 51.51.51.51

produces a normal and conventional display of data.

However since ARIN, the North American registrar of IP addresses,
"modernised" its WHOIS processing, a query to

       whois 64.64.64.64

will produce a one line summary of possible matches, which always
includes ARIN, but omits the details we used to receive before ARIN
implemented its much criticised "improved" service.

A one line script solves it for me (but only for ARIN network entries).

       #!/bin/bash
       whois -h whois.arin.net n + $1

I call my script .arin

       .arin 64.64.64.64

produces a normal output.



Paul.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos



--
Dr. Ed Morbius
Chief Scientist / Philologist / Robot Wrangler / Powerplant Operator
Krell Power Systems Unlimited