yocto/yoclib-dns

This yocLibrary enables your project to do DNS-specific operations.

dev-master 2025-03-12 21:03 UTC

This package is auto-updated.

Last update: 2025-03-12 21:03:20 UTC


README

This yocLibrary enables your project to do DNS-specific operations.

Status

PHP Composer codecov

Installation

composer require yocto/yoclib-dns

Usage

Deserializing

use YOCLIB\DNS\Helpers\TypeHelper;

// Deserialize from presentation format
$aRecord = TypeHelper::deserializeFromPresentationFormatByClassAndType('127.0.0.1',DNSClass::IN,DNSType::A);

// Deserialize from wire format
$aRecord = TypeHelper::deserializeFromWireFormatByClassAndType("\x7F\x00\x00\x01",DNSClass::IN,DNSType::A);

Serializing

use YOCLIB\DNS\Types\A;

$aRecord = new A('127.0.0.1');

// Serialize to presentation format
$aRecord->serializeToPresentationFormat();

// Serialize to wire format
$aRecord->serializeToWireFormat();