1Net::DNS::Question(3) User Contributed Perl DocumentationNet::DNS::Question(3)
2
3
4
6 Net::DNS::Question - DNS question class
7
9 "use Net::DNS::Question"
10
12 A "Net::DNS::Question" object represents a record in the question
13 section of a DNS packet.
14
16 new
17 $question = Net::DNS::Question->new("example.com", "MX", "IN");
18
19 Creates a question object from the domain, type, and class passed as
20 arguments.
21
22 RFC4291 and RFC4632 IP address/prefix notation is supported for queries
23 in in-addr.arpa and ip6.arpa subdomains.
24
25 parse
26 ($question, $offset) = Net::DNS::Question->parse(\$data, $offset);
27
28 Parses a question section record at the specified location within a DNS
29 packet. The first argument is a reference to the packet data. The
30 second argument is the offset within the packet where the question
31 record begins.
32
33 Returns a Net::DNS::Question object and the offset of the next location
34 in the packet.
35
36 Parsing is aborted if the question object cannot be created (e.g.,
37 corrupt or insufficient data).
38
39 qname, zname
40 print "qname = ", $question->qname, "\n";
41 print "zname = ", $question->zname, "\n";
42
43 Returns the domain name. In dynamic update packets, this field is
44 known as "zname" and refers to the zone name.
45
46 qtype, ztype
47 print "qtype = ", $question->qtype, "\n";
48 print "ztype = ", $question->ztype, "\n";
49
50 Returns the record type. In dymamic update packets, this field is
51 known as "ztype" and refers to the zone type (must be SOA).
52
53 qclass, zclass
54 print "qclass = ", $question->qclass, "\n";
55 print "zclass = ", $question->zclass, "\n";
56
57 Returns the record class. In dynamic update packets, this field is
58 known as "zclass" and refers to the zone's class.
59
60 print
61 $question->print;
62
63 Prints the question record on the standard output.
64
65 string
66 print $qr->string, "\n";
67
68 Returns a string representation of the question record.
69
70 data
71 $qdata = $question->data($packet, $offset);
72
73 Returns the question record in binary format suitable for inclusion in
74 a DNS packet.
75
76 Arguments are a "Net::DNS::Packet" object and the offset within that
77 packet's data where the "Net::DNS::Question" record is to be stored.
78 This information is necessary for using compressed domain names.
79
81 Copyright (c) 1997-2002 Michael Fuhr.
82
83 Portions Copyright (c) 2002-2004 Chris Reinhardt.
84
85 Portions Copyright (c) 2003,2006-2007 Dick Franks.
86
87 All rights reserved. This program is free software; you may
88 redistribute it and/or modify it under the same terms as Perl itself.
89
91 perl(1), Net::DNS, Net::DNS::Resolver, Net::DNS::Packet,
92 Net::DNS::Update, Net::DNS::Header, Net::DNS::RR, RFC 1035 Section
93 4.1.2
94
95
96
97perl v5.12.0 2009-01-26 Net::DNS::Question(3)