cvs: peardoc /en/package/networking net-dns.xml /en/package/networking/net-dns/net-dns-resolver axfr.xml query.xml rawQuery.xml

From: Date: Sun, 10 Apr 2005 20:26:50 +0000
Subject: cvs: peardoc /en/package/networking net-dns.xml /en/package/networking/net-dns/net-dns-resolver axfr.xml query.xml rawQuery.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5918@lists.php.net to get a copy of this message
ekilfoil Sun Apr 10 16:26:50 2005 EDT Added files: /peardoc/en/package/networking/net-dns/net-dns-resolver axfr.xml Modified files: /peardoc/en/package/networking net-dns.xml /peardoc/en/package/networking/net-dns/net-dns-resolver query.xml rawQuery.xml Log: Yet more documentation for Net_DNS... there is more to come. finished for now

http://cvs.php.net/diff.php/peardoc/en/package/networking/net-dns.xml?r1=1.2&r2=1.3&ty=u Index: peardoc/en/package/networking/net-dns.xml diff -u peardoc/en/package/networking/net-dns.xml:1.2 peardoc/en/package/networking/net-dns.xml:1.3 --- peardoc/en/package/networking/net-dns.xml:1.2 Sun Apr 10 13:25:42 2005 +++ peardoc/en/package/networking/net-dns.xml Sun Apr 10 16:26:50 2005 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <sect1 id="package.networking.net-dns"> <title>Net_DNS</title> <para> @@ -53,8 +53,332 @@ </para> </refsect1> </refentry> + <refentry id="package.networking.net-dns.net-dns-rr-intro"> + <refnamediv> + <refname> + Class Summary <classname>Net_DNS_RR</classname> + </refname> + <refpurpose> + Provides resource record parsing and creation + </refpurpose> + </refnamediv> + <refsect1> + <title>Net_DNS_RR</title> + <para> + The Net_DNS_RR class provides methods of parsing + resource records returned by a nameserver, creation of + resource record objects to be sent to a nameserver, and + the ability to access each component of an RR as an + object property. + </para> + <para> + Each resource record object MUST contain the following properties: + <itemizedlist> + <listitem><para><parameter>name</parameter> - The DNS name of the RR</para></listitem> + <listitem><para><parameter>type</parameter> - The RR type</para></listitem> + <listitem><para><parameter>class</parameter> - The RR class (normally IN)</para></listitem> + <listitem><para><parameter>ttl</parameter> - The RR time to live</para></listitem> + <listitem><para><parameter>rdlength</parameter> - The amount of data (in bytes) of the rdata section</para></listitem> + <listitem><para><parameter>rdata</parameter> - The data (uncompressed) of the right hand side of the RR</para></listitem> + </itemizedlist> + </para> + <para> + If <parameter>type</parameter> is a supported RR type, + it will automatically be decompressed and/or decoded + into its appropriate property values. The values inside + of an RR object will vary based on the type of RR. + </para> + <para> + Supported RR types: + <itemizedlist> + <listitem> + <para> + A + <itemizedlist> + <listitem> + <para> + string <parameter>address</parameter> - IPv4 style address + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + AAAA + <itemizedlist> + <listitem> + <para> + string <parameter>address</parameter> - IPv6 style address + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + CNAME + <itemizedlist> + <listitem> + <para> + string <parameter>cname</parameter> - The canonical name of the queried host + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + HINFO + <itemizedlist> + <listitem> + <para> + string <parameter>cpu</parameter> - The host CPU type + </para> + </listitem> + <listitem> + <para> + string <parameter>os</parameter> - Type host operating system + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + MX + <itemizedlist> + <listitem> + <para> + integer <parameter>preference</parameter> - The MX preference (lower takes priority + </para> + </listitem> + <listitem> + <para> + string <parameter>exchange</parameter> - The name of the mail exchange host + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + NAPTR + <itemizedlist> + <listitem> + <para> + unknown <parameter>order</parameter> - unknown + </para> + </listitem> + <listitem> + <para> + unknown <parameter>preference</parameter> - unknown + </para> + </listitem> + <listitem> + <para> + unknown <parameter>flags</parameter> - unknown + </para> + </listitem> + <listitem> + <para> + unknown <parameter>services</parameter> - unknown + </para> + </listitem> + <listitem> + <para> + unknown <parameter>regex</parameter> - unknown + </para> + </listitem> + <listitem> + <para> + unknown <parameter>replacement</parameter> - unknown + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + NS + <itemizedlist> + <listitem> + <para> + string <parameter>nsdname</parameter> - The name of the NS record nameserver + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + PTR + <itemizedlist> + <listitem> + <para> + string <parameter>ptrdname</parameter> - The name for the queried IP address + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + SOA + <itemizedlist> + <listitem> + <para> + string <parameter>mname</parameter> - Master nameserver hostname as + specified in the SOA record - not neccessarily accurate + </para> + </listitem> + <listitem> + <para> + string <parameter>rname</parameter> - Email address of the person + responsible for the zone - not neccessarily accurate + </para> + </listitem> + <listitem> + <para> + string <parameter>serial</parameter> - The serial number (version + number) of the retrieved zone + </para> + </listitem> + <listitem> + <para> + string <parameter>refresh</parameter> - The length of time before + the zone should be refresed + </para> + </listitem> + <listitem> + <para> + string <parameter>retry</parameter> - The length of time between + retries for slave servers to refresh the zone + </para> + </listitem> + <listitem> + <para> + string <parameter>expire</parameter> - The length of time before + slave servers should consider the data invalid without refreshing + the zone data. + </para> + </listitem> + <listitem> + <para> + string <parameter>minimum</parameter> - The default TTL for RRs + inside of the zone that are not otherwise specified. + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + SRV + <itemizedlist> + <listitem> + <para> + unknown <parameter>preference</parameter> - unknown + </para> + </listitem> + <listitem> + <para> + unknown <parameter>weight</parameter> - unknown + </para> + </listitem> + <listitem> + <para> + unknown <parameter>port</parameter> - unknown + </para> + </listitem> + <listitem> + <para> + unknown <parameter>target</parameter> - unknown + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + TSIG + <itemizedlist> + <listitem> + <para> + integer <parameter>time_signed</parameter> - The time the signature + has was created + </para> + </listitem> + <listitem> + <para> + integer <parameter>fudge</parameter> - The time offset that is + acceptable between the client and the server + </para> + </listitem> + <listitem> + <para> + integer <parameter>mac_size</parameter> - The size of the following + signature data + </para> + </listitem> + <listitem> + <para> + string/binary <parameter>mac</parameter> - The data containing the + has sent by the client/server + </para> + </listitem> + <listitem> + <para> + integer <parameter>original_id</parameter> - The ID sent to or + received from the server identifying this query. + </para> + </listitem> + <listitem> + <para> + integer <parameter>error</parameter> - The value of the error + calculating or verifying the signature. + </para> + </listitem> + <listitem> + <para> + integer <parameter>other_len</parameter> - The amount of data (in + bytes) additional to the signature + </para> + </listitem> + <listitem> + <para> + string <parameter>other_data</parameter> - Additional data required + by the nameserver for the signature. + </para> + </listitem> + <listitem> + <para> + string <parameter>key</parameter> - The key shared by the client and + the server to validate authorization. + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + <listitem> + <para> + TXT + <itemizedlist> + <listitem> + <para> + string <parameter>text</parameter> - The text defined in the record + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + </itemizedlist> + </para> + </refsect1> + </refentry> &package.networking.net-dns.net-dns-resolver.query; &package.networking.net-dns.net-dns-resolver.rawQuery; + &package.networking.net-dns.net-dns-resolver.axfr; </sect1> <!-- Generated by phpDocumentor v 1.2.3 http://www.phpdoc.org --> <!-- Keep this comment at the end of the file http://cvs.php.net/diff.php/peardoc/en/package/networking/net-dns/net-dns-resolver/query.xml?r1=1.3&r2=1.4&ty=u Index: peardoc/en/package/networking/net-dns/net-dns-resolver/query.xml diff -u peardoc/en/package/networking/net-dns/net-dns-resolver/query.xml:1.3 peardoc/en/package/networking/net-dns/net-dns-resolver/query.xml:1.4 --- peardoc/en/package/networking/net-dns/net-dns-resolver/query.xml:1.3 Sun Apr 10 13:31:44 2005 +++ peardoc/en/package/networking/net-dns/net-dns-resolver/query.xml Sun Apr 10 16:26:50 2005 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="package.networking.net-dns.net-dns-resolver.query"> <refnamediv> <refname>Net_DNS_Resolver::query()</refname> @@ -20,6 +20,19 @@ <refsect1 id="package.networking.net-dns.net-dns-resolver.query.desc"> &title.desc; <para> + <itemizedlist> + <listitem> + <para><parameter>hostname</parameter> - The name to lookup (eg. www.php.net)</para> + </listitem> + <listitem> + <para><parameter>type</parameter> - The record type to query</para> + </listitem> + <listitem> + <para><parameter>class</parameter> - The zone class to query</para> + </listitem> + </itemizedlist> + </para> + <para> Constructs a DNS query packet and forwards the query to a nameserver configured in the system stub resolver (ie. /etc/resolv.conf). When a response is received from the DNS @@ -47,6 +60,11 @@ This is useful when doing manual recursion. </para> <para> + For a description of the returned RR data object, see + <link + linkend="package.networking.net-dns.net-dns-rr-intro">Net_DNS_RR</link>. + </para> + <para> Resolver Configuration Object Properties: <itemizedlist> <listitem> http://cvs.php.net/diff.php/peardoc/en/package/networking/net-dns/net-dns-resolver/rawQuery.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/en/package/networking/net-dns/net-dns-resolver/rawQuery.xml diff -u peardoc/en/package/networking/net-dns/net-dns-resolver/rawQuery.xml:1.1 peardoc/en/package/networking/net-dns/net-dns-resolver/rawQuery.xml:1.2 --- peardoc/en/package/networking/net-dns/net-dns-resolver/rawQuery.xml:1.1 Sun Apr 10 13:27:46 2005 +++ peardoc/en/package/networking/net-dns/net-dns-resolver/rawQuery.xml Sun Apr 10 16:26:50 2005 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.networking.net-dns.net-dns-resolver.rawQuery"> <refnamediv> <refname>Net_DNS_Resolver::rawQuery()</refname> @@ -20,6 +20,19 @@ <refsect1 id="package.networking.net-dns.net-dns-resolver.rawQuery.desc"> &title.desc; <para> + <itemizedlist> + <listitem> + <para><parameter>hostname</parameter> - The name to lookup (eg. www.php.net)</para> + </listitem> + <listitem> + <para><parameter>type</parameter> - The record type to query</para> + </listitem> + <listitem> + <para><parameter>class</parameter> - The zone class to query</para> + </listitem> + </itemizedlist> + </para> + <para> The <function>Net_DNS_Resolver::rawQuery</function> function performs a DNS query similar to the <link @@ -34,6 +47,11 @@ <link linkend="package.networking.net-dns.net-dns-resolver.query">Net_DNS_Resolver::query()</link>. </para> + <para> + For a description of the returned RR data object, see + <link + linkend="package.networking.net-dns.net-dns-rr-intro">Net_DNS_RR</link>. + </para> </refsect1> <refsect1 id="packages.networking.net-dns.net-dns-resolver.rawQuery.example"> &title.example; http://cvs.php.net/co.php/peardoc/en/package/networking/net-dns/net-dns-resolver/axfr.xml?r=1.1&p=1 Index: peardoc/en/package/networking/net-dns/net-dns-resolver/axfr.xml +++ peardoc/en/package/networking/net-dns/net-dns-resolver/axfr.xml <!-- $Revision: 1.1 $ --> <refentry id="package.networking.net-dns.net-dns-resolver.axfr"> <refnamediv> <refname>Net_DNS_Resolver::axfr()</refname> <refpurpose>Performs a zone transfer from a nameserver</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once('Net/DNS.php'); </funcsynopsisinfo> <funcprototype> <funcdef>Net_DNS_Packet <function>Net_DNS_Resolver::axfr</function></funcdef> <paramdef>string <parameter>$dname</parameter></paramdef> <paramdef>string <parameter><optional>$class = 'IN'</optional></parameter></paramdef> <paramdef>boolean <parameter><optional>$old = FALSE</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.networking.net-dns.net-dns-resolver.axfr.desc"> &title.desc; <para> <itemizedlist> <listitem> <para><parameter>dname</parameter> - The domain name (zone name) to transfer</para> </listitem> <listitem> <para><parameter>class</parameter> - The zone class to transfer</para> </listitem> <listitem> <para><parameter>old</parameter> - Only used for backwards compatibility with previous version of Net_DNS</para> </listitem> </itemizedlist> </para> <para> axfr() attempts a zone transfer from the nameservers specified in the Net_DNS_Resolver->nameservers array. <function>Net_DNS_Resolver::axfr</function> uses the same resolver configuration as the <link linkend="package.networking.net-dns.net-dns-resolver.query">Net_DNS_Resolver::query()</link> method. </para> <para> Most public nameservers will not allow a zone transfer by default. A zone transfer will provide a full list of DNS resource records inside of a zone file. A zone transfer will always use TCP instead of UDP queries. </para> <para> For a description of the returned RR data object, see <link linkend="package.networking.net-dns.net-dns-rr-intro">Net_DNS_RR</link>. </para> </refsect1> <refsect1 id="packages.networking.net-dns.net-dns-resolver.axfr.example"> &title.example; <example> <title>Failed <function>Net_DNS_Resolver::axfr</function> query</title> <programlisting role="php"> <![CDATA[ <?php require_once 'Net/DNS.php'; $resolver = new Net_DNS_Resolver(); $resolver->debug = 1; $response = $resolver->axfr('example.com'); print_r($response); if (count($response) == 0) { echo "\n"; echo "AXFR Failed\n"; } ?> ]]> </programlisting> <para> Output: </para> <screen> <![CDATA[ ;; axfr_start(example.com, IN) ;; query(example.com, AXFR, IN) ;; axfr_start(192.168.0.254:53) ;; sending 29 bytes ;; read_tcp: expecting 2 bytes ;; read_tcp: received 2 bytes ;; read_tcp: expecting 29 bytes ;; read_tcp: received 29 bytes ;; received 29bytes ;; HEADER SECTION ;; id = 29190 ;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 1 ;; ra = 1 rcode = NOTAUTH ;; qdcount = 1 ancount = 0 nscount = 0 arcount = 0 ;; QUESTION SECTION (1 record) ;; ;example.com. IN AXFR ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (0 records) ;; ADDITIONAL SECTION (0 records) Array ( ) AXFR Failed ]]> </screen> </example> <para> In the following example, debugging has been turned on and the nameserver has been configured to allow zone transfers. The most important item of note in this example is the SOA record at the beginning and end of the returned records. When a name server sends a zone transfer, the first record sent is the SOA record. The zone transfer is considered complete when the name server sends the SOA record again. This behaviour can be seen in the debug output. The resulting array returned by axfr() does not return the final SOA record. </para> <example> <title>Succesful <function>Net_DNS_Resolver::axfr</function> query</title> <programlisting role="php"> <![CDATA[ <?php require_once 'Net/DNS.php'; $resolver = new Net_DNS_Resolver(); $resolver->debug = 1; $response = $resolver->axfr('my.example.com'); echo "\n\nThe following resource records were returned from the nameserver:\n"; if (count($response)) { foreach ($response as $rr) { $rr->display(); } } ?> ]]> </programlisting> <para> Output: </para> <screen> <![CDATA[ ;; axfr_start(my.example.com, IN) ;; query(my.example.com, AXFR, IN) ;; axfr_start(192.168.0.254:53) ;; sending 32 bytes ;; read_tcp: expecting 2 bytes ;; read_tcp: received 2 bytes ;; read_tcp: expecting 262 bytes ;; read_tcp: received 262 bytes ;; received 262bytes ;; HEADER SECTION ;; id = 21220 ;; qr = 1 opcode = QUERY aa = 1 tc = 0 rd = 0 ;; ra = 1 rcode = NOERROR ;; qdcount = 1 ancount = 10 nscount = 0 arcount = 0 ;; QUESTION SECTION (1 record) ;; ;my.example.com. IN AXFR ;; ANSWER SECTION (10 records) my.example.com. 300 IN SOA ns1.my.example.com. hostmaster.my.example.com. 103 3600 1800 2592000 300 my.example.com. 300 IN NS ns1.my.example.com. my.example.com. 300 IN MX 10 mx1.my.example.com. my.example.com. 300 IN MX 20 mx2.my.example.com. my.example.com. 300 IN A 192.168.0.1 mx1.my.example.com. 300 IN A 192.168.0.2 mx2.my.example.com. 300 IN A 192.168.0.3 server.my.example.com. 300 IN CNAME www.my.example.com. www.my.example.com. 300 IN A 192.168.0.1 my.example.com. 300 IN SOA ns1.my.example.com. hostmaster.my.example.com. 103 3600 1800 2592000 300 ;; AUTHORITY SECTION (0 records) ;; ADDITIONAL SECTION (0 records) The following resource records were returned from the nameserver: my.example.com. 300 IN SOA ns1.my.example.com. hostmaster.my.example.com. 103 3600 1800 2592000 300 my.example.com. 300 IN NS ns1.my.example.com. my.example.com. 300 IN MX 10 mx1.my.example.com. my.example.com. 300 IN MX 20 mx2.my.example.com. my.example.com. 300 IN A 192.168.0.1 mx1.my.example.com. 300 IN A 192.168.0.2 mx2.my.example.com. 300 IN A 192.168.0.3 server.my.example.com. 300 IN CNAME www.my.example.com. www.my.example.com. 300 IN A 192.168.0.1 ]]> </screen> </example> </refsect1> <refsect1 id="package.networking.net-dns.net-dns-resolver.axfr.note"> &title.note; &note.notstatic; </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=60 syn=sgml vi: ts=1 sw=1 -->
« previous php.pear.doc (#5918) next »