1Net::DNS::Question(3) User Contributed Perl DocumentationNet::DNS::Question(3)
2
3
4
6 Net::DNS::Question - DNS question record
7
9 use Net::DNS::Question;
10
11 $question = new Net::DNS::Question('example.com', 'A', 'IN');
12
14 A Net::DNS::Question object represents a record in the question section
15 of a DNS packet.
16
18 new
19 $question = new Net::DNS::Question('example.com', 'A', 'IN');
20 $question = new Net::DNS::Question('example.com');
21
22 $question = new Net::DNS::Question('192.0.32.10', 'PTR', 'IN');
23 $question = new Net::DNS::Question('192.0.32.10');
24
25 Creates a question object from the domain, type, and class passed as
26 arguments. One or both type and class arguments may be omitted and will
27 assume the default values shown above.
28
29 RFC4291 and RFC4632 IP address/prefix notation is supported for queries
30 in both in-addr.arpa and ip6.arpa namespaces.
31
32 decode
33 $question = decode Net::DNS::Question(\$data, $offset);
34
35 ($question, $offset) = decode Net::DNS::Question(\$data, $offset);
36
37 Decodes the question record at the specified location within a DNS
38 wire-format packet. The first argument is a reference to the buffer
39 containing the packet data. The second argument is the offset of the
40 start of the question record.
41
42 Returns a Net::DNS::Question object and the offset of the next location
43 in the packet.
44
45 An exception is raised if the object cannot be created (e.g., corrupt
46 or insufficient data).
47
48 encode
49 $data = $question->encode( $offset, $hash );
50
51 Returns the Net::DNS::Question in binary format suitable for inclusion
52 in a DNS packet buffer.
53
54 The optional arguments are the offset within the packet data where the
55 Net::DNS::Question is to be stored and a reference to a hash table used
56 to index compressed names within the packet.
57
58 name
59 $name = $question->name;
60
61 Internationalised domain name corresponding to the qname attribute.
62
63 Decoding non-ASCII domain names is computationally expensive and
64 undesirable for names which are likely to be used to construct further
65 queries.
66
67 When required to communicate with humans, the 'proper' domain name
68 should be extracted from a query or reply packet.
69
70 $query = new Net::DNS::Packet( $example, 'ANY' );
71 $reply = $resolver->send($query) or die;
72 ($question) = $reply->question;
73 $name = $question->name;
74
75 qname, zname
76 $qname = $question->qname;
77 $zname = $question->zname;
78
79 Canonical ASCII domain name as required for the query subject
80 transmitted to a nameserver. In dynamic update packets, this attribute
81 is known as zname() and refers to the zone name.
82
83 qtype, ztype
84 $qtype = $question->qtype;
85 $ztype = $question->ztype;
86
87 Returns the question type attribute. In dynamic update packets, this
88 attribute is known as ztype() and refers to the zone type.
89
90 qclass, zclass
91 $qclass = $question->qclass;
92 $zclass = $question->zclass;
93
94 Returns the question class attribute. In dynamic update packets, this
95 attribute is known as zclass() and refers to the zone class.
96
97 print
98 $object->print;
99
100 Prints the record to the standard output. Calls the string() method to
101 get the string representation.
102
103 string
104 print "string = ", $question->string, "\n";
105
106 Returns a string representation of the question record.
107
109 Copyright (c)1997-2002 Michael Fuhr.
110
111 Portions Copyright (c)2002-2004 Chris Reinhardt.
112
113 Portions Copyright (c)2003,2006-2011 Dick Franks.
114
115 All rights reserved.
116
117 This program is free software; you may redistribute it and/or modify it
118 under the same terms as Perl itself.
119
121 perl, Net::DNS, Net::DNS::DomainName, Net::DNS::Packet, RFC 1035
122 Section 4.1.2
123
124
125
126perl v5.16.3 2012-12-28 Net::DNS::Question(3)