Message Board

Newbie/Basic Questions

Older Posts ]   [ Newer Posts ]
 Problem?
Author: N.Anuzis   (26 Mar 14 8:57am)
Hi Guys,
I'm making an IP processor and want to include HP as an information source.
I'm using the file_get_contents and It's saying "failed to open stream",

When I put "abcdefghijkl.2.1.9.127.dnsbl.httpbl.org" into Chrome with my Key and another IP it says "google chrome cannot find this address" but NOT the "not found" just like you would get if you try that sample URL.

So I'm assuming it must be my KEY or the IP (which is unlikely)
Do I need to activate my key again or something?
Or am I missing something fundementally wrong like I have to host my own HP?

Much appreciated,
Nick
 
 Re: Problem?
Author: H.User1325   (26 Mar 14 11:47am)
The problem is that Chrome (or any browser) doesn't ask the correct question. Go back and read the first paragraph of "DNS query Format." You will see " For example, from the command line of a Unix-based machine, you could run a DIG or NSLOOKUP query for a particular address."

A DIG or LSLOOKUP "ask" your servers DNS to translate the name sent into an IP address, aaa.bbb.ccc.ddd. On the other hand a browser "ask" to have the content of that address downloaded. Not knowing your level of understanding (don't want to insult you) but maybe another way of saying that is the difference between what you want to ask is "What is Bill's phone number?" and what you're ask through your browser is "Connect me to Bill's phone so I can talk to him."

Bill -> "abcdefghijkl.2.1.9.127.dnsbl.httpbl.org" which should return 127.3.5.1 if ask correctly.

Any browser, including Chrome, is designed to give you the content of the address you enter. What you want is what looks like "the IP address" of what you entered.

Sorry re-read your OP. You need to use a gethostbyname() not a file_get_content. Your query format is correct just using the wrong function.

covering all bases:
Asking the question correctly and you KEY is no dough good. the IP 127.9.1.2 returns the results listed in the documentation.
If your KEY is listed on you dashboard is is good.
OR missing something ... No you do not need to host you own HP. (BUT I would suggest that you do, to add to the fight.)


Hope this helps.
 
 Re: Problem?
Author: H.User1325   (26 Mar 14 12:14pm)
RE-reading one more time:
"When I put "abcdefghijkl.2.1.9.127.dnsbl.httpbl.org" into Chrome with my Key and another IP it says "google chrome cannot find this address" but NOT the "not found" just like you would get if you try that sample URL."

When ask correctly using a DIG or in php gethostbyname() you should get 127.3.5.1 returned as stated in the example in the documentation which translates to 3 days 5 score Suspicious.

When you enter "abcdefghijkl.2.1.9.127.dnsbl.httpbl.org" Chrome tries to get a DNS service to return an IP address so a connection can be established. ~~ "google chrome cannot find this address." Don't know why there are more than one "not found" message.

Post Edited (26 Mar 14 12:20pm)
 
 Re: Problem?
Author: N.Anuzis   (27 Mar 14 8:05am)
Thanks for replying,
Other API's I've requested normally you can type in Domain.Query.Config into URL and receive the answer, kind of like there is no difference between asking someone to call Bill and putting in the number yourself? haha

I think I understand now though. I didn't understand the reason for using Gethostbyname when that returns an IP http://www.php.net/manual/en/function.gethostbyname.php
since I'm used to array responses etc.
however, thats the response format so that's why it's returning an IP, am I right?

Thanks again,
Nick
 
 Re: Problem?
Author: N.Anuzis   (27 Mar 14 8:18am)
I've fixed it,
This is why I posted in the newbie section...

I was testing my code using my IP, a generated IP (i knew to be BL but years ago) and the test values. This however was responding back with the original query.

$remote_ip = "93.182.133.143";

$query = $apikey . "." . implode ( '.', array_reverse ( explode ( '.', $remote_ip ) ) ) .
".dnsbl.httpbl.org";

echo $query;
$results = gethostbyname($query);
echo $results;

However i tested it with a recent IP from HP and it came up with the correct response.
Basically I thought it wasn't working because I was testing it with IP's that weren't blacklisted...

If a response is just the original query, for exception handling I assume that response means it's just not blacklisted?

Much appreciated!
 
 Re: Problem?
Author: H.User1325   (27 Mar 14 4:40pm)
Nick, sounds like you got it.

$return = gethostbyname($query);

if ($return == $query)
{
$result = 'NXDOMAIN';
}
else
{
// evaluate returned octets
}

Lou



do not follow this link

Privacy Policy | Terms of Use | About Project Honey Pot | FAQ | Cloudflare Site Protection | Contact Us

Copyright © 2004–17, Unspam Technologies, Inc. All rights reserved.

contact | wiki | email