Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ip = '';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'http://whois.arin.net/rest/ip/' . $ip);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
- $returnValue = curl_exec($ch);
- curl_close($ch);
- $result = json_decode($returnValue);
- $rdns = gethostbyaddr($ip);
- echo $rdns;
- echo $result->net->name->{'$'};
- echo $result->net->orgRef->{'@name'};
- ?>
- Output:
- cpe-24-92-*-*.nycap.res.rr.com
- Name: ROAD-RUNNER-3
- OrgRef: Road Runner HoldCo LLC
Advertisement
Add Comment
Please, Sign In to add comment