note 73071 added to function.checkdnsrr

From: Date: Thu, 08 Feb 2007 00:31:52 +0000
Subject: note 73071 added to function.checkdnsrr
Groups: php.notes 
Request: Send a blank email to php-notes+get-123102@lists.php.net to get a copy of this message
Check DNSBL - WIN / Linux, using a command line tool called: "arblcheck". First you need to get the arblcheck tool, you can get it here: http://www.unixwiz.net/tools/arblcheck.html Windows: Copy it into your system32 directory and make sure iis server has rights to execute cmd.exe. Linux Redhat: Dunno, did not check it... <?php // Domain to check $domain = "yousite.com"; //OR $domain = "xxx.xxx.xxx.xxx"; // List of DNSBL Checking sites $RBLSites = array( "list.dsbl.org", "multihop.dsbl.org", "unconfirmed.dsbl.org", "bl.spamcop.net", "sbl.spamhaus.org", "cbl.abuseat.org", "l2.spews.dnsbl.sorbs.net" ); // Initialize vars $cmd = "arblcheck -c"; $DNSBLError = ""; // Build the cmd string foreach($RBLSites as $site) { $cmd .= " -s " . $site; } // Add current domain $cmd .= " " . $domain; // Start the DNSBL check exec($cmd, $response); // Check response if(!empty($response)) { // If we got response foreach($response as $line) { // Check each line of the response if(eregi(".*not.*", $line)) { // Set the error $DNSBLError = "none"; } else { // Set the error $DNSBLError = "***POSSIBLE SPAM***"; break; } } } // If we have no response or a unexisting domain else { // Set the error $DNSBLError = "***POSSIBLE SPAM***"; } echo $DNSBLError; ?> Sorry I did not find the time to build this into a function, should be fairly simple :) ---- Server IP: 87.238.162.147 Probable Submitter: 84.192.170.11 ---- Manual Page -- http://www.php.net/manual/en/function.checkdnsrr.php Edit -- https://master.php.net/note/edit/73071 Del: integrated -- https://master.php.net/note/delete/73071/integrated Del: useless -- https://master.php.net/note/delete/73071/useless Del: bad code -- https://master.php.net/note/delete/73071/bad+code Del: spam -- https://master.php.net/note/delete/73071/spam Del: non-english -- https://master.php.net/note/delete/73071/non-english Del: in docs -- https://master.php.net/note/delete/73071/in+docs Del: other reasons-- https://master.php.net/note/delete/73071 Reject -- https://master.php.net/note/reject/73071 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#123102) next »