$ record = new NSEC ([
'host ' => "bluelibraries.com " ,
'ttl ' => 3600 ,
'next-authoritative-name ' => "auth.bluelibraries.com " ,
'types ' => "A AAAA NS SOA "
]);
echo 'getHost = ' . $ record ->getHost () . PHP_EOL ;
echo 'getTtl = ' . $ record ->getTtl () . PHP_EOL ;
echo 'getClass = ' . $ record ->getClass () . PHP_EOL ;
echo 'getTypeName = ' . $ record ->getTypeName () . PHP_EOL ;
echo 'getNextAuthoritativeName = ' . $ record ->getNextAuthoritativeName () . PHP_EOL ;
echo 'getTypes = ' . $ record ->getTypes () . PHP_EOL ;
getHost = bluelibraries.com
getTtl = 3600
getClass = IN
getTypeName = NSEC
getNextAuthoritativeName = auth.bluelibraries.com
getTypes = A AAAA NS SOA
$ record = new NSEC ();
$ record ->setData ([
'host ' => "bluelibraries.com " ,
'ttl ' => 3600 ,
'next-authoritative-name ' => "auth.bluelibraries.com " ,
'types ' => "A AAAA NS SOA "
]);
echo 'getHost = ' . $ record ->getHost () . PHP_EOL ;
echo 'getTtl = ' . $ record ->getTtl () . PHP_EOL ;
echo 'getClass = ' . $ record ->getClass () . PHP_EOL ;
echo 'getTypeName = ' . $ record ->getTypeName () . PHP_EOL ;
echo 'getNextAuthoritativeName = ' . $ record ->getNextAuthoritativeName () . PHP_EOL ;
echo 'getTypes = ' . $ record ->getTypes () . PHP_EOL ;
getHost = bluelibraries.com
getTtl = 3600
getClass = IN
getTypeName = NSEC
getNextAuthoritativeName = auth.bluelibraries.com
getTypes = A AAAA NS SOA
$ record = Record::fromString ('bluelibraries.com 3600 IN NSEC auth.bluelibraries.com A AAAA NS SOA ' );
echo 'getHost = ' . $ record ->getHost () . PHP_EOL ;
echo 'getTtl = ' . $ record ->getTtl () . PHP_EOL ;
echo 'getClass = ' . $ record ->getClass () . PHP_EOL ;
echo 'getTypeName = ' . $ record ->getTypeName () . PHP_EOL ;
echo 'getNextAuthoritativeName = ' . $ record ->getNextAuthoritativeName () . PHP_EOL ;
echo 'getTypes = ' . $ record ->getTypes () . PHP_EOL ;
getHost = bluelibraries.com
getTtl = 3600
getClass = IN
getTypeName = NSEC
getNextAuthoritativeName = auth.bluelibraries.com
getTypes = A AAAA NS SOA
Create from initialized array
$ record = Record::fromNormalizedArray ([
'host ' => "bluelibraries.com " ,
'ttl ' => 3600 ,
'next-authoritative-name ' => "auth.bluelibraries.com " ,
'types ' => "A AAAA NS SOA " ,
'type ' => "NSEC "
]);
echo 'getHost = ' . $ record ->getHost () . PHP_EOL ;
echo 'getTtl = ' . $ record ->getTtl () . PHP_EOL ;
echo 'getClass = ' . $ record ->getClass () . PHP_EOL ;
echo 'getTypeName = ' . $ record ->getTypeName () . PHP_EOL ;
echo 'getNextAuthoritativeName = ' . $ record ->getNextAuthoritativeName () . PHP_EOL ;
echo 'getTypes = ' . $ record ->getTypes () . PHP_EOL ;
getHost = bluelibraries.com
getTtl = 3600
getClass = IN
getTypeName = NSEC
getNextAuthoritativeName = auth.bluelibraries.com
getTypes = A AAAA NS SOA
$ records = DNS ::getRecords ('bluelibraries.com ' , RecordTypes::NSEC );
print_r ($ records );
Array
(
[0] => BlueLibraries\Dns\Records\Types\DnsSec\NSEC Object
(
[data:protected] => Array
(
[host] => bluelibraries.com
[ttl] => 3600
[next-authoritative-name] => auth.bluelibraries.com
[types] => A AAAA NS SOA
[type] => NSEC
[class] => IN
)
)
)
$ dns = new DnsRecords ();
$ records = $ dns ->get ('bluelibraries.com ' , RecordTypes::NSEC );
print_r ($ records );
Array
(
[0] => BlueLibraries\Dns\Records\Types\DnsSec\NSEC Object
(
[data:protected] => Array
(
[host] => bluelibraries.com
[ttl] => 3600
[next-authoritative-name] => auth.bluelibraries.com
[types] => A AAAA NS SOA
[type] => NSEC
[class] => IN
)
)
)
Retrieve without helper, using custom handler settings
$ dnsHandler = new TCP ();
$ dnsHandler ->setRetries (2 );
$ dnsHandler ->setTimeout (3 );
$ dnsHandler ->setNameserver ('8.8.8.8 ' );
$ dns = new DnsRecords ($ dnsHandler );
$ records = $ dns ->get ('bluelibraries.com ' , RecordTypes::NSEC );
print_r ($ records );
Array
(
[0] => BlueLibraries\Dns\Records\Types\DnsSec\NSEC Object
(
[data:protected] => Array
(
[host] => bluelibraries.com
[ttl] => 3600
[next-authoritative-name] => auth.bluelibraries.com
[types] => A AAAA NS SOA
[type] => NSEC
[class] => IN
)
)
)
$ record = new NSEC ([
'host ' => "bluelibraries.com " ,
'ttl ' => 3600 ,
'next-authoritative-name ' => "auth.bluelibraries.com " ,
'types ' => "A AAAA NS SOA "
]);
echo 'string1 = ' . json_encode ($ record ->toString ()) . PHP_EOL ;
echo 'string2 = ' . json_encode ((string )$ record ) . PHP_EOL ;
string1 = "bluelibraries.com 3600 IN NSEC auth.bluelibraries.com A AAAA NS SOA"
string2 = "bluelibraries.com 3600 IN NSEC auth.bluelibraries.com A AAAA NS SOA"
$ record = new NSEC ([
'host ' => "bluelibraries.com " ,
'ttl ' => 3600 ,
'next-authoritative-name ' => "auth.bluelibraries.com " ,
'types ' => "A AAAA NS SOA "
]);
echo 'JSON = ' . json_encode ($ record ) . PHP_EOL ;
JSON = {"host":"bluelibraries.com","ttl":3600,"next-authoritative-name":"auth.bluelibraries.com","types":"A AAAA NS SOA","class":"IN","type":"NSEC"}
$ record = new NSEC ([
'host ' => "bluelibraries.com " ,
'ttl ' => 3600 ,
'next-authoritative-name ' => "auth.bluelibraries.com " ,
'types ' => "A AAAA NS SOA "
]);
print_r ($ record ->toArray ());
Array
(
[host] => bluelibraries.com
[ttl] => 3600
[next-authoritative-name] => auth.bluelibraries.com
[types] => A AAAA NS SOA
[class] => IN
[type] => NSEC
)