示例#1
0
 /**
  * Start
  *
  * @author Koen Blokland Visser
  * @author Richard Oosterhof
  */
 public function setUp()
 {
     $DNSCollection = new DNSCollection();
     $DNSCollection->setARecords('192.168.1.1')->setAAAARecords('super.long.aaaa.record')->setMXRecords(['mail.test', 10])->setTXTRecords('long.txt.record')->setNSRecords('NS1.example.com');
     $this->DNSChecker = new DNSChecker();
     $this->DNSChecker->setDNSCollection($DNSCollection);
     parent::setUp();
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function feed($domainName)
 {
     $DNSCollection = new DNSCollection();
     $records = dns_get_record($domainName, DNS_ALL);
     foreach ($records as $record) {
         if (isset($record['type']) === false) {
             continue;
         }
         if ($record['type'] === 'A') {
             $DNSCollection->setARecords($record['ip']);
         } elseif ($record['type'] === 'AAAA') {
             $DNSCollection->setAAAARecords($record['ipv6']);
         } elseif ($record['type'] === 'MX') {
             $DNSCollection->setMXRecords([$record['target'], $record['pri']]);
         } elseif ($record['type'] === 'TXT') {
             $DNSCollection->setTXTRecords($record['txt']);
         } elseif ($record['type'] === 'NS') {
             $DNSCollection->setNSRecords($record['target']);
         }
     }
     return $DNSCollection;
 }
示例#3
0
 /**
  * Test the aaaa record
  *
  * @author Koen Blokland Visser
  * @author Richard Oosterhof
  */
 public function testAAAARecordTest()
 {
     $this->DNSCollection->setARecords('FE80:0000:0000:0000:0202:B3FF');
     $this->DNSCollection->setARecords('2001:cdba:0000:0000:3257.9652');
     $this->assertSame(['FE80:0000:0000:0000:0202:B3FF', '2001:cdba:0000:0000:3257.9652'], $this->DNSCollection->getARecords());
 }