DNS-Unbound

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

The following may be called either as object methods or as static
functions (but not as class methods). In addition to these,
[Socket](https://metacpan.org/pod/Socket) provides the `inet_ntoa()` and `inet_ntop()`
functions for decoding the values of `A` and `AAAA` records.

**NOTE:** Consider parsing [DNS::Unbound::Result](https://metacpan.org/pod/DNS%3A%3AUnbound%3A%3AResult)’s `answer_packet()`
as a more robust, albeit heavier, way to parse query result data.
[Net::DNS::Packet](https://metacpan.org/pod/Net%3A%3ADNS%3A%3APacket) and [AnyEvent::DNS](https://metacpan.org/pod/AnyEvent%3A%3ADNS)’s `dns_unpack()` are two good
ways to parse DNS packets.

## $decoded = decode\_name($encoded)

Decodes a DNS name. Useful for, e.g., `NS`, `CNAME`, and `PTR` query
results.

Note that this function’s return will normally include a trailing `.`
because of the trailing NUL byte in an encoded DNS name. This is normal
and expected.

## $strings\_ar = decode\_character\_strings($encoded)

lib/DNS/Unbound.pm  view on Meta::CPAN

The following may be called either as object methods or as static
functions (but not as class methods). In addition to these,
L<Socket> provides the C<inet_ntoa()> and C<inet_ntop()>
functions for decoding the values of C<A> and C<AAAA> records.

B<NOTE:> Consider parsing L<DNS::Unbound::Result>’s C<answer_packet()>
as a more robust, albeit heavier, way to parse query result data.
L<Net::DNS::Packet> and L<AnyEvent::DNS>’s C<dns_unpack()> are two good
ways to parse DNS packets.

=head2 $decoded = decode_name($encoded)

Decodes a DNS name. Useful for, e.g., C<NS>, C<CNAME>, and C<PTR> query
results.

Note that this function’s return will normally include a trailing C<.>
because of the trailing NUL byte in an encoded DNS name. This is normal
and expected.

=cut



( run in 0.467 second using v1.01-cache-2.11-cpan-26ccb49234f )