Posted at: 2016-09-10 09:10:35  Category: programming

RDAP使うっていってもただhttpでリクエスト投げるだけです。

RDAPの問い合わせ結果はJSONで返ってきます。

なのでdrakmaとcl-json使います。

以下のようなコードを書きます



実行すると結果がJSONで返ってきます



* (rdap-request "https://rdap.apnic.net/ip/192.41.192.129")



((:HANDLE . "192.41.192.0 - 192.41.192.255") (:START-ADDRESS . "192.41.192.0")

(:END-ADDRESS . "192.41.192.255") (:IP-VERSION . "v4") (:NAME . "JPNICNET")

(:TYPE . "ASSIGNED PORTABLE") (:COUNTRY . "JP")

(:OBJECT-CLASS-NAME . "ip network")

(:ENTITIES

((:HANDLE . "IRT-JPNIC-JP")

(:VCARD-ARRAY "vcard"

(("version" NIL "text" "4.0") ("fn" NIL "text" "IRT-JPNIC-JP")

("kind" NIL "text" "group")

("email" ((:PREF . "1")) "text" "hostmaster@nic.ad.jp")

("adr"

((:LABEL

. "Urbannet-Kanda Bldg 4F, 3-6-2 Uchi-Kanda\\nChiyoda-ku, Tokyo 101-0047, Japan"))

"text" ("" "" "" "" "" "" ""))

("email" NIL "text" "hostmaster@nic.ad.jp")))

(:ROLES "abuse") (:OBJECT-CLASS-NAME . "entity")

(:LINKS

((:VALUE . "https://rdap.apnic.net/ip/192.41.192.0/24") (:REL . "self")

(:HREF . "https://rdap.apnic.net/entity/IRT-JPNIC-JP")

(:TYPE . "application/rdap+json"))))

((:HANDLE . "JE53-AP")

(:VCARD-ARRAY "vcard"

(("version" NIL "text" "4.0") ("fn" NIL "text" "JPNIC Engineering Group")

("kind" NIL "text" "individual")

("adr"

((:LABEL

. "Urbannet-Kanda Bldg 4F\\n3-6-2 Uchi-Kanda\\nChiyoda-ku, Tokyo 101-0047,Japan"))

"text" ("" "" "" "" "" "" ""))

("tel" ((:TYPE . "voice")) "text" "+81-3-5297-2311")

("tel" ((:TYPE . "fax")) "text" "+81-3-5297-2312")

("email" NIL "text" "hostmaster@nic.ad.jp")))

(:ROLES "technical") (:OBJECT-CLASS-NAME . "entity")

(:LINKS

((:VALUE . "https://rdap.apnic.net/ip/192.41.192.0/24") (:REL . "self")

(:HREF . "https://rdap.apnic.net/entity/JE53-AP")

(:TYPE . "application/rdap+json"))))

((:HANDLE . "JI13-AP")

(:VCARD-ARRAY "vcard"

(("version" NIL "text" "4.0") ("fn" NIL "text" "JPNIC IP Department")

("kind" NIL "text" "individual")

("adr"

((:LABEL

. "Urbannet-Kanda Bldg 4F\\n3-6-2 Uchi-Kanda\\nChiyoda-ku, Tokyo 101-0047,Japan"))

"text" ("" "" "" "" "" "" ""))

("tel" ((:TYPE . "voice")) "text" "+81-3-5297-2311")

("tel" ((:TYPE . "fax")) "text" "+81-3-5297-2312")

("email" NIL "text" "hostmaster@nic.ad.jp")))

(:ROLES "administrative") (:OBJECT-CLASS-NAME . "entity")

(:LINKS

((:VALUE . "https://rdap.apnic.net/ip/192.41.192.0/24") (:REL . "self")

(:HREF . "https://rdap.apnic.net/entity/JI13-AP")

(:TYPE . "application/rdap+json")))))

(:REMARKS

((:TITLE . "description")

(:DESCRIPTION "Japan Network Information Center" "Urbannet-Kanda Bldg 4F"

"3-6-2 Uchi-Kanda" "Chiyoda-ku, Tokyo 101-0047, Japan"))

((:TITLE . "remarks")

(:DESCRIPTION

"Email address for spam or abuse complaints : hostmaster@nic.ad.jp")))

(:LINKS

((:VALUE . "https://rdap.apnic.net/ip/192.41.192.0/24") (:REL . "self")

(:HREF . "https://rdap.apnic.net/ip/192.41.192.0/24")

(:TYPE . "application/rdap+json")))

(:EVENTS

((:EVENT-ACTION . "last changed") (:EVENT-DATE . "2012-09-11T01:26:58Z")))

(:RDAP-CONFORMANCE "rdap_level_0")

(:NOTICES

((:TITLE . "Source")

(:DESCRIPTION "Objects returned came from source" "APNIC"))

((:TITLE . "Terms and Conditions")

(:DESCRIPTION

"This is the APNIC WHOIS Database query service. The objects are in RDAP format.")

(:LINKS

((:VALUE . "https://rdap.apnic.net/ip/192.41.192.129")

(:REL . "terms-of-service")

(:HREF . "http://www.apnic.net/db/dbcopyright.html")

(:TYPE . "text/html")))))

(:PORT-43 . "whois.apnic.net"))