1Net::DNS::Domain(3) User Contributed Perl Documentation Net::DNS::Domain(3)
2
3
4
6 Net::DNS::Domain - DNS 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 computational expense of Unicode character-set conversion is
26 partially mitigated by use of caches.
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 Users should be aware that non-ASCII domain names will be transcoded to
51 NFC before encoding, which is an irreversible process.
52
53 name
54 $name = $domain->name;
55
56 Returns the domain name as a character string corresponding to the
57 "common interpretation" to which RFC1034, 3.1, paragraph 9 alludes.
58
59 Character escape sequences are used to represent a dot inside a domain
60 name label and the escape character itself.
61
62 Any non-printable code point is represented using the appropriate
63 numerical escape sequence.
64
65 fqdn
66 @fqdn = $domain->fqdn;
67
68 Returns a character string containing the fully qualified domain name,
69 including the trailing dot.
70
71 xname
72 $xname = $domain->xname;
73
74 Interprets an extended name containing Unicode domain name labels
75 encoded as Punycode A-labels.
76
77 If decoding is not possible, the ACE encoded name is returned.
78
79 label
80 @label = $domain->label;
81
82 Identifies the domain by means of a list of domain labels.
83
84 string
85 $string = $object->string;
86
87 Returns a character string containing the fully qualified domain name
88 as it appears in a zone file.
89
90 Characters which are recognised by RFC1035 zone file syntax are
91 represented by the appropriate escape sequence.
92
93 origin
94 $create = origin Net::DNS::Domain( $ORIGIN );
95 $result = &$create( sub{ new Net::DNS::RR( 'mx MX 10 a' ); } );
96 $expect = new Net::DNS::RR( "mx.$ORIGIN. MX 10 a.$ORIGIN." );
97
98 Class method which returns a reference to a subroutine wrapper which
99 executes a given constructor in a dynamically scoped context where
100 relative names become descendents of the specified $ORIGIN.
101
103 Coding strategy is intended to avoid creating unnecessary argument
104 lists and stack frames. This improves efficiency at the expense of code
105 readability.
106
107 Platform specific character coding features are conditionally compiled
108 into the code.
109
111 Copyright (c)2009-2011,2017 Dick Franks.
112
113 All rights reserved.
114
116 Permission to use, copy, modify, and distribute this software and its
117 documentation for any purpose and without fee is hereby granted,
118 provided that the above copyright notice appear in all copies and that
119 both that copyright notice and this permission notice appear in
120 supporting documentation, and that the name of the author not be used
121 in advertising or publicity pertaining to distribution of the software
122 without specific prior written permission.
123
124 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
125 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
126 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
127 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
128 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
129 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
130 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
131
133 perl, Net::DNS, Net::LibIDN2, RFC1034, RFC1035, RFC5891, Unicode TR#16
134
135
136
137perl v5.28.1 2018-11-14 Net::DNS::Domain(3)