使用 PHP,我想descr:
从 RIPE IP 地址范围的 whois 记录中获取该行的内容,所以它们应该看起来像这样:
% This is RIPE NCC's Routing Information Service
% whois gateway to collected BGP Routing Tables
% IPv4 or IPv6 address to origin prefix match
%
% For more information visit http://www.ripe.net/ris/riswhois.html
route: 53.0.0.0/8
origin: AS31399
descr: DAIMLER-AS Daimler Autonomous System
lastupd-frst: 2011-12-08 23:18Z 195.66.224.97@rrc01
lastupd-last: 2012-01-25 15:18Z 203.119.76.3@rrc00
seen-at: rrc00,rrc01,rrc03,rrc04,rrc05,rrc07,rrc10,rrc11,rrc12,rrc13,rrc14,rrc15,rrc16
num-rispeers: 98
source: RISWHOIS
所以我应该得到DAIMLER-AS Daimler Autonomous System
结果。
如何用最少的代码做到这一点,我在 $whois 中有记录。
<?php
$whois = shell_exec('whois -h riswhois.ripe.net ' . $ip);
?>