1Net::DNS::Domain(3) User Contributed Perl Documentation Net::DNS::Domain(3)
2
3
4
6 Net::DNS::Domain - Domain Name System domains
7
9 use Net::DNS::Domain;
10
11 $domain = new Net::DNS::Domain('example.com');
12 $name = $domain->name;
13
15 The Net::DNS::Domain module implements a class of abstract DNS domain
16 objects with associated class and instance methods.
17
18 Each domain object instance represents a single DNS domain which has a
19 fixed identity throughout its lifetime.
20
21 Internally, the primary representation is a (possibly empty) list of
22 ASCII domain name labels, and optional link to an arbitrary origin
23 domain object topologically closer to the DNS root.
24
25 The presentation form of the domain name is generated on demand and the
26 result cached within the object.
27
29 new
30 $object = new Net::DNS::Domain('example.com');
31
32 Creates a domain object which represents the DNS domain specified by
33 the character string argument. The argument consists of a sequence of
34 labels delimited by dots.
35
36 A character preceded by \ represents itself, without any special
37 interpretation.
38
39 Arbitrary 8-bit codes can be represented by \ followed by exactly three
40 decimal digits. Character code points are ASCII, irrespective of the
41 character coding scheme employed by the underlying platform.
42
43 Argument string literals should be delimited by single quotes to avoid
44 escape sequences being interpreted as octal character codes by the Perl
45 compiler.
46
47 The character string presentation format follows the conventions for
48 zone files described in RFC1035.
49
50 name
51 $name = $domain->name;
52
53 Returns the domain name as a character string corresponding to the
54 "common interpretation" to which RFC1034, 3.1, paragraph 9 alludes.
55
56 Character escape sequences are used to represent a dot inside a domain
57 name label and the escape character itself.
58
59 Any non-printable code point is represented using the appropriate
60 numerical escape sequence.
61
62 fqdn
63 @fqdn = $domain->fqdn;
64
65 Returns a character string containing the fully qualified domain name,
66 including the trailing dot.
67
68 xname
69 $xname = $domain->xname;
70
71 Interprets an extended name containing Unicode domain name labels
72 encoded as Punycode A-labels.
73
74 Domain names containing Unicode characters are supported if the
75 Net::LibIDN module is installed.
76
77 label
78 @label = $domain->label;
79
80 Identifies the domain by means of a list of domain labels.
81
82 string
83 $string = $object->string;
84
85 Returns a character string containing the fully qualified domain name
86 as it appears in a zone file.
87
88 Characters which are recognised by RFC1035 zone file syntax are
89 represented by the appropriate escape sequence.
90
91 origin
92 $create = origin Net::DNS::Domain( $ORIGIN );
93 $result = &$create( sub{ new Net::DNS::RR( 'mx MX 10 a' ); } );
94 $expect = new Net::DNS::RR( "mx.$ORIGIN. MX 10 a.$ORIGIN." );
95
96 Class method which returns a reference to a subroutine wrapper which
97 executes a given constructor in a dynamically scoped context where
98 relative names are rooted at the specified $ORIGIN.
99
101 Coding strategy is intended to avoid creating unnecessary argument
102 lists and stack frames. This improves efficiency at the expense of code
103 readability.
104
105 Platform specific character coding features are conditionally compiled
106 into the code.
107
109 Copyright (c)2009-2011 Dick Franks.
110
111 All rights reserved.
112
113 This program is free software; you may redistribute it and/or modify it
114 under the same terms as Perl itself.
115
117 perl, Net::LibIDN, Net::DNS, RFC1034, RFC1035, RFC5891, Unicode
118 Technical Report #16
119
120
121
122perl v5.16.3 2012-12-28 Net::DNS::Domain(3)