How to update "Look up IP"

Started by a10, July 13, 2013, 06:18:52 AM

Previous topic - Next topic

a10

I find the 'Look up IP on a regional whois-server' very practical and helpful, currently arin & ripe = The requested URL /whois was not found.

Some tips on how\where to do the edits to get them working again? (stock 1.1.18)

Thanks.
2.0.19, php 8.0.23, MariaDB 10.5.15. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.


a10

#2
Thanks, the (parsed) mod is correct for arin.

Found all within lines 2046-2070 in Sources\Profile.php, did these changes that seems to work fine:

line 2059: 'url' => 'http://whois.arin.net/rest/ip/'; . $context['ip'],
line 2069: 'url' => 'https://apps.db.ripe.net/search/query.html?searchtext='; . $context['ip'],
2.0.19, php 8.0.23, MariaDB 10.5.15. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

BPDFamily.com

The problem is that SMF outputs the IP request with decimal points and the ARIN site formats IP addresses with hypens.

The SMF request is for: http://ws.arin.net/whois/?queryinput=142.54.172.210
ARIN wants: http://whois.arin.net/rest/net/NET-142-54-172-210/pft

I used another address as a quick/crude fix.

'arin' => array(
'name' => &$txt['whois_arin'],
'url' => 'http://viewdns.info/whois/?domain=' . $context['ip'],
'range' => array(63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 199, 204, 205, 206, 207, 208, 209, 216),
),


Is there a more elegant fix?

BPDFamily.com

For anyone want to set up the arrays so they work (highlight the registry based on the IP address), you will need the current IPv4 blocks for each region registry.  I've updated those here (see number sequences).

$context['whois_servers'] = array(
'arin' => array(
'name' => &$txt['whois_arin'],
'url' => 'http://viewdns.info/whois/?domain=' . $context['ip'],
'range' => array(23, 24, 45, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 96, 97, 98, 99,199, 104, 107, 108, 135, 136, 142, 147, 162, 166, 172, 173, 174, 184, 192, 198, 199, 204, 205, 206, 207, 208, 209, 216),
),
'ripe' => array(
'name' => &$txt['whois_ripe'],
'url' => 'http://www.db.ripe.net/whois?searchtext=' . $context['ip'],
'range' => array(2, 5, 31, 37, 46, 62, 77, 78, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 109, 176, 178, 188, 193, 194, 195, 196, 212, 213, 217),
),
'lacnic' => array(
'name' => &$txt['whois_lacnic'],
'url' => 'http://lacnic.net/cgi-bin/lacnic/whois?query=' . $context['ip'],
'range' => array(202, 203),
),
'apnic' => array(
'name' => &$txt['whois_apnic'],
'url' => 'http://wq.apnic.net/apnic-bin/whois.pl?searchtext=' . $context['ip'],
'range' => array(1, 14, 27, 36, 39, 42, 43, 45, 49, 58, 59, 60, 61, 101, 103, 106, 110, 111, 113, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 150, 163, 169, 175, 180, 182, 183, 202, 203, 210, 211, 218, 219, 220, 221, 222, 223),
),
'afrinic' => array(
'name' => &$txt['whois_afrinic'],
'url' => 'http://www.afrinic.net/cgi-bin/whois?searchtext=' . $context['ip'],
'range' => array(200,201),
),
);


I added these two trackers to my list to find geographic locations and to look for proxy servers.

'geoloc' => array(
'name' => &$txt['whois_geoloc'],
'url' => 'http://en.utrace.de/?query=' . $context['ip'],
'range' => array(),
),
'host' => array(
'name' => &$txt['whois_host'],
'url' => 'http://reverseip.domaintools.com/search/?q=' . $context['ip'],
'range' => array()
),


You will also need to name "whois_host" and "whois_geoloc" on the profile.enhlish.php page (see themes/default/languages)

Advertisement: