Jump to content

testmy.net not correctly detecting my host


bibio

Recommended Posts

Hi!

I am pretty new to broadband, I have had it only for 1 full week now. I am on DSL with sympatico.ca, and want to test my download speed.  The test runs fine, but when the results are displayed, the script tells me my host is something like 132.276 or any weird IP adress not related to sympatico.ca

I have observed, though, that this only happens when the other computer on my home LAN, which runs XP with S.P. 2, is running. When it is not running, the script on the page correctly detects that my I.S.P. is sympatico.ca.

Does anyone have an idea of why does this happen?

Link to comment
Share on other sites

Hi!

I am pretty new to broadband, I have had it only for 1 full week now. I am on DSL with sympatico.ca, and want to test my download speed.  The test runs fine, but when the results are displayed, the script tells me my host is something like 132.276 or any weird IP adress not related to sympatico.ca

I have observed, though, that this only happens when the other computer on my home LAN, which runs XP with S.P. 2, is running. When it is not running, the script on the page correctly detects that my I.S.P. is sympatico.ca.

Does anyone have an idea of why does this happen?

Well, it detects your host by a reverse lookup.  It works fine for most people, but sometimes it will show a portion of your IP addy.  If you are going through a router or gasteway this might be messing this up.... I have written in the code to do a quick check, meaning if it takes too long it will just give up (so that people don't have to wait around for a reverse DNS resolution) ~~ don't worry about it, you know who your host is and can still compare your score to your host by using the "host stats" tool ... just type "sympatico.ca" or look for it in the drop down box :-D

Link to comment
Share on other sites

cale couldnt u be using something like that Arin database ?

takes too long to query ~~ I use gethostbyaddr($ip)

this is the full code of getting someones IP then converting it to a host and dropping off un-needed data


function GetIPu()
{
if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
$ipu = getenv("HTTP_CLIENT_IP");
else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown"))
$ipu = getenv("HTTP_X_FORWARDED_FOR");
else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown"))
$ipu = getenv("REMOTE_ADDR");
else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown"))
$ipu = $_SERVER['REMOTE_ADDR'];
else
$ipu = "unknown";
return($ipu);
}

function get_isp($ip = '') {
    if (empty($ip)) {
        $ip = GetIPu();
    }
    $longisp = gethostbyaddr($ip);
    $isp    = explode('.', $longisp);
    $ispr    = array_reverse($isp);
    $isp    = $ispr[1].'.'.$ispr[0];
    return $isp;
}

$host=get_isp();
[/code]

If someone can tell me a better way to do it I am open for discussion :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...