The aim of this project is to create abstract object representations of DNS records in PHP. The project consists of various classes representing DNS objects (such as Zone, ResourceRecord, and various RData types), a parser to convert BIND style text files to the PHP objects, and builders to create aesthetically pleasing BIND records.
$ORIGIN
is the root domain ("."). (Thank you, Cedric Dubois)christian-riesen/base32
instead of ademarre/binary-to-text-php
.Badcow\DNS\Rdata\RdataInterface::fromWire
is no longer static and does not return an instance of the class. You now
must instantiate the object first, and then call fromWire
method. All parameters are the same.Badcow\DNS\Rdata\RdataInterface::fromText
is no longer static and does not return an instance of the class. You now
must instantiate the object first, and then call fromText
method. All parameters are the same.Bacow\DNS\Rdata\Algorithms
, use Bacow\DNS\Algorithms
instead.KEY::setPublicKey($key)
now expects the raw binary form of the public key. Similarly KEY::getPublicKey()
returns
a raw binary public key. base64_decode()
and base64_encode()
should be used on the setter and getter, respectively,
if you want to handle Base64 encoded string. These changes apply to all child classes as well (DNSKEY
and CDNSKEY
).DS::setDigest($digest)
now expects the raw binary form of the digest. Similarly DS::getDigest
returns a raw binary
digest. hex2bin()
and bin2hex()
should be used on the setter and getter, respectively, if you want to handle
hexadecimal encoded strings. These changes apply to all child classes as well (CDS
, DLV
and TA
).CERT::setCertificate($cert)
now expects the raw binary form of the certificate. Similarly CERT::getCertificate()
returns a raw binary certificate. base64_decode()
and base64_encode()
should be used on the setter and getter, respectively,
if you want to handle Base64 encoded strings.DHCID::setDigest($digest)
now expects the raw binary form of the digest. Similarly DHCID::getDigest
returns a raw
binary digest. hex2bin()
and bin2hex()
should be used on the setter and getter, respectively, if you want to handle
hexadecimal encoded strings.IPSECKEY::setPublicKey($key)
now expects the raw binary form of the public key. Similarly IPSECKEY::getPublicKey()
returns a raw binary public key. base64_decode()
and base64_encode()
should be used on the setter and getter, respectively,
if you want to handle Base64 encoded strings.NSEC3::setNextHashedOwner($key)
now expects the raw binary form of the hash. Similarly NSEC3::getNextHashedOwner()
returns a raw binary hash. NSEC3::base32decode()
and NSEC3::base32encode()
should be used on the setter and getter,
respectively, if you want to handle Base32 encoded strings.RRSIG::setSignature($signature)
now expects the raw binary form of the signature. Similarly RRSIG::getSignature()
returns
a raw binary signature. base64_decode()
and base64_encode()
should be used on the setter and getter, respectively,
if you want to handle Base64 encoded string. These changes apply to the child class SIG
as well.SSHFP::setFingerprint($fingerprint)
now expects the raw binary form of the fingerprint. Similarly SSHFP::getFingerprint
returns a raw binary fingerprint. hex2bin()
and bin2hex()
should be used on the setter and getter, respectively,
if you want to handle hexadecimal encoded strings.DS::calculateDigest(string $owner, DNSKEY $dnskey)
will calculate and set the digest using the DNSKEY rdata object.$nextOwnerName
with respective setter and getters NSEC3::setNextOwnerName($nextOwnerName)
and NSEC3::getNextOwnerName()
. This new parameter will not be rendered in the rdata text or wire formats, but can be
used to calculate the nextOwnerHashedName
.NSEC3::calculateNextOwnerHash()
to calculate and set NSEC3::nextOwnerHash
. Requires
NSEC3::salt
, NSEC3::nextOwnerName
, and NSEC3::iterations
to be set before calling method.Factory::NSEC3()
has been changed to take only the following parameters:
[bool]$unsignedDelegationsCovered
[int]$iterations
[string]$salt
[string]$nextOwnerName
[array] $types
TXT::toText()
now splits string into 255-byte chunks. (Thank you, @fbett)Badow\DNS\AlignedBuilder
now has finer controls. You can now
define the order of rendering Resource Records and add or change Rdata output formatters (see Docs/AlignedZoneBuilder
).Badow\DNS\AlignedBuilder
cannot be called statically anymore. It must be instantiated.Badcow\DNS\Message
Badcow\DNS\Opcode
Badcow\DNS\Question
Badcow\DNS\Parser\StringIterator::getRemainingAsString()
.Badcow\DNS\Rdata\RdataInterface::fromWire()
: RdataInterface::fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null)
.Badcow\DNS\Rdata\RdataTrait::decodeName()
now can interpret RFC1035 compressed names in a DNS message context.Bacow\DNS\Rdata\Algorithms
, use Bacow\DNS\Algorithms
instead.$TTL
is set, the Parser
will set the TTL on all resource records to that TTL if one is not explicitly set.
If no $TTL
is set, then the resource record will adopt the last defined $TTL.Parser no longer ignores $ORIGIN control entry.