* * This is the copyright notice from the PERL Net::DNS module: * * Copyright (c) 1997-2000 Michael Fuhr. All rights reserved. This * program is free software; you can redistribute it and/or modify it * under the same terms as Perl itself. * * The majority of this is _NOT_ my code. I simply ported it from the * PERL Net::DNS module. * * The author of the Net::DNS module is Michael Fuhr * http://www.fuhr.org/~mfuhr/perldns/ * * I _DO_ maintain this code, and Miachael Fuhr has nothing to with the * porting of this code to PHP. Any questions directly related to this * class library should be directed to me. * * I'll be setting up a CVS repository for this class soon. The more * emails i get concerning this, the more apt i am to do it. * * License Information: * * Net_DNS: A resolver library for PHP * Copyright (c) 2002-2003 Eric Kilfoil eric@ypass.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Include information {{{ */ $phpdns_basedir = 'Net'; require_once("$phpdns_basedir/DNS/Header.php"); require_once("$phpdns_basedir/DNS/Question.php"); require_once("$phpdns_basedir/DNS/Packet.php"); require_once("$phpdns_basedir/DNS/Resolver.php"); require_once("$phpdns_basedir/DNS/RR.php"); /* }}} */ /* GLOBAL VARIABLE definitions {{{ */ // Used by the Net_DNS_Resolver object to generate an ID mt_srand((double) microtime() * 10000); $_Net_DNS_packet_id = (int)mt_rand(0, 65535); /* }}} */ /* Net_DNS object definition (incomplete) {{{ */ /** * Initializes a resolver object * * Net_DNS allows you to query a nameserver for DNS lookups. It bypasses the * system resolver library entirely, which allows you to query any nameserver, * set your own values for retries, timeouts, recursion, etc. * * @author Eric Kilfoil * @package Net_DNS * @version 0.01alpha */ class Net_DNS { /* class variable definitions {{{ */ /** * A default resolver object created on instantiation * * @var object Net_DNS_Resolver */ var $resolver; var $VERSION = '1.00b2'; // This should probably be a define :( var $PACKETSZ = 512; var $HFIXEDSZ = 12; var $QFIXEDSZ = 4; var $RRFIXEDSZ = 10; var $INT32SZ = 4; var $INT16SZ = 2; /* }}} */ /* class constructor - Net_DNS() {{{ */ /** * Initializes a resolver object * * @see Net_DNS_Resolver */ function Net_DNS() { $this->resolver = new Net_DNS_Resolver(); } /* }}} */ /* Net_DNS::opcodesbyname() {{{ */ /** * Translates opcode names to integers * * Translates the name of a DNS OPCODE into it's assigned number * listed in RFC1035, RFC1996, or RFC2136. Valid OPCODES are: *