NAME

Stanford::DNS - DNS Name Functions and Constants

SYNOPSIS

use Stanford::DNS;

$answer = dns_answer(QPTR, T_TXT, C_IN, 60, rr_TXT($text));

DESCRIPTION

Stanford::DNS defines DNS name functions and constants. The dns_answer function is perhaps the most important function. It is used to create DNS answers returned by Stanford::DNSserver dynamic request handlers. The rr_* family of functions are used to format the data needed by dns_answer.

FUNCTIONS

dns_answer $qptr, $type, $class, $ttl, $rdata

Returns a DNS answer of type $type and class $class with TTL $ttl using the input resource record data $rdata.

rr_* $data

Stanford::DNS defines resource record functions for most DNS record types. The most common types are listed below. Please refer to the source for the rest.

  • rr_A $ip_address

    Format an address record.

  • rr_CNAME $name

    Format a CNAME (alias) address record.

  • rr_NS $name

    Format a name server record.

  • rr_PTR $name

    Format a pointer (reverse lookup) record.

  • rr_MX $preference, $name

    Format a mail exchanger record.

  • rr_SOA $mname, $rname, $serial, $refresh, $retry, $expire, $min

    Format a start of authority record.

  • rr_TXT $text

    Format a text record.

CONSTANTS

Stanford::DNS defines many DNS constants. The most commonly used are listed below. Please refer to the source for the rest.

  • QPTR

    Pointer to the original question in a DNS packet.

  • T_A

    Address record type.

  • T_NS

    Name server record type.

  • T_CNAME

    Canonical name (alias) record type.

  • T_SOA

    Start of authority record type.

  • T_PTR

    Pointer record type.

  • T_MX

    Mail exchanger record type.

  • T_TXT

    Text record type.

  • C_IN

    Internet record class.

  • C_ANY

    Any record class.

  • NOERROR

    Success code.

  • FORMERR

    Unable to interpret the query error code.

  • SERVFAIL

    Problem with the name server error code.

  • NXDOMAIN

    The domain name does not exist error code.

  • NOTIMP

    Not implemented error code.

  • REFUSED

    Query disallowed by policy error code.

SEE ALSO

Net::Enum::DNSserver