dev-master
9999999-dev http://github.com/webeith/dnsblDNSBL service
MIT
The Requires
- php >=5.3.2
by webeith
dnsbl
DNSBL service
``` php <?php, (*2)
use Dnsbl\Dnsbl, Dnsbl\Resolver, Dnsbl\BL\Server;, (*3)
$domainResolver = new Resolver\NetDnsDomainResolver(); $ipResolver = new Resolver\NetDnsIPResolver();, (*4)
// Checking from url. Example how to create custom resolver. $urlResolver = new Resolver\UrlResolver(); $urlResolver->setLocation('https://zeustracker.abuse.ch/blocklist.php?download=baddomains');, (*5)
// Checking from file. file_put_contents('zeustracker.ip.bl.file', file_get_contents('https://zeustracker.abuse.ch/blocklist.php?download=ipblocklist')); $fileResolver = new Resolver\FileResolver('zeustracker.ip.bl.file');, (*6)
$dnsbl = new Dnsbl();, (*7)
$servers = array( new Server('zeustracker.abuse.ch', $urlResolver, array('domain', 'IPv4')), new Server('zeustracker.ip.bl.file', $fileResolver, array('IPv4')), new Server('dbl.spamhaus.org', $domainResolver, array('domain')), new Server('pbl.spamhaus.org', $ipResolver, array('IPv4')) );, (*8)
$dnsbl->setBlServers($servers);, (*9)
// Checking in bl who is supported domain. print_r($dnsbl->checkDomain('advanc320.co.vu'));, (*10)
// Checking in bl who is supported IP. print_r($dnsbl->checkIP('127.0.0.2'));, (*11)
// Checking in all bl. print_r($dnsbl->check('advanc320.co.vu'));, (*12)
Installation ------------ ``` bash $> php composer.phar require webeith/dnsbl
DNSBL service
MIT
dnsbl