Hello
I am looking for some simple PHP based functionality that will allow me to query the SURBL database for a domain name and confirm if it is a spamvertised one or not. Is there any engine for this?
I would like this functionality on hosted domains as well, which means setting up a DNS resolution etc may be impractical.
All I need is some online location to which I can send an input (a URL, or just the domain name) and get back a "YES" or a "NO" indicating whether this domain name is clean or not.
Thanks for any ideas!
Shanx
On Sunday, July 18, 2004, 3:40:22 AM, Shashank Tripathi wrote:
I am looking for some simple PHP based functionality that will allow me to query the SURBL database for a domain name and confirm if it is a spamvertised one or not. Is there any engine for this?
I would like this functionality on hosted domains as well, which means setting up a DNS resolution etc may be impractical.
All I need is some online location to which I can send an input (a URL, or just the domain name) and get back a "YES" or a "NO" indicating whether this domain name is clean or not.
Wouldn't dns_get_record() in PHP, specifically the DNS_A option resolve domains?
http://us2.php.net/manual/en/function.dns-get-record.php
For example:
<?php $result = dns_get_record("domainundertest.com.multi.surbl.org", DNS_A); print_r($result); ?>
Would query domainundertest.com in multi.surbl.org and return an A record if the domain is listed, or none if it's not.
One drawback noted on the manual page above:
"This function is not implemented on Windows platforms. Try the PEAR class Net_DNS."
But presumably that class has similar capabilities.
Remember that like other RBLs, the SURBL data is in the form of DNS records, so all that's needed to look up the data is name resolution.
Jeff C.
At 13:34 2004-07-18 -0700, Jeff Chan wrote:
On Sunday, July 18, 2004, 3:40:22 AM, Shashank Tripathi wrote:
I am looking for some simple PHP based functionality that will allow me to query the SURBL database for a domain name and confirm if it is a spamvertised one or not. Is there any engine for this?
I would like this functionality on hosted domains as well, which means setting up a DNS resolution etc may be impractical.
All I need is some online location to which I can send an input (a URL, or just the domain name) and get back a "YES" or a "NO" indicating whether this domain name is clean or not.
Wouldn't dns_get_record() in PHP, specifically the DNS_A option resolve domains?
Just a note since I've been down this road myself:
dns_get_record is PHP 5 only*, which was in beta until last week. Many installations will probably stay with 4.x until 5.1 is released.
If you only want to check the existence of an A record, with 4.x, you can use checkdnsrr instead. http://us2.php.net/manual/en/function.checkdnsrr.php
You can not get TXT records with checkdnsrr though, so if you want check those as well under PHP 4.x (multi.surbl.org is more interesting if you do...), you have to use work-arounds, like directly calling exec nslookup.
I have a 4.x php script that I use that's quite ugly, but works for me - if anyone is interested in it just let me know and I'll pass it on.
*) There is a back-port of dns_get_record for PHP 4.x. It didn't work for me. Others might be more lucky...
Patrik
On Sunday, July 18, 2004, 3:03:38 PM, Patrik Nilsson wrote:
At 13:34 2004-07-18 -0700, Jeff Chan wrote:
Wouldn't dns_get_record() in PHP, specifically the DNS_A option resolve domains?
dns_get_record is PHP 5 only*, which was in beta until last week. Many installations will probably stay with 4.x until 5.1 is released.
If you only want to check the existence of an A record, with 4.x, you can use checkdnsrr instead. http://us2.php.net/manual/en/function.checkdnsrr.php
You can not get TXT records with checkdnsrr though, so if you want check those as well under PHP 4.x (multi.surbl.org is more interesting if you do...), you have to use work-arounds, like directly calling exec nslookup.
Thanks for the addition info about name resolution under php Patrik.
For everyone's info, we recommend using the A records for any sort of automated procedures rather than the TXT records. The A records are likely to be the most stable.
For multi.surbl.org, the A records are encoded in a simple bitmasking scheme where each source list has a corresponding bit position. More details are at:
http://www.surbl.org/lists.html#multi
Jeff C.