Is there any way to use PHP code to query a DNSBL (block list) provider and find out if the IP address submitted is a bad actor?
I would like to take an existing IP address out of a registration database, then check whether it's a known block-listed IP address by performing a lookup on it, then if it's a blacklisted, do an action on it (such as, delete entry from registration database).
Most of the instructions I have seen assume you are trying to query the blocklist via a mail server, which I can't do. I tried querying v开发者_StackOverflowia web browser by typing in queries such as "58.64.xx.xxx.dnsbl.sorbs.net" but that didn't work.
There are a bunch of examples for this available in the php manual starting at this comment
http://www.php.net/manual/en/function.checkdnsrr.php#72297
This one should work
http://www.php.net/manual/en/function.checkdnsrr.php#53953
精彩评论