Net::DNS::Resolver man page on BSDOS

Man page or keyword search:  
man Server   6284 pages
apropos Keyword Search (all sections)
Output format
BSDOS logo
[printable version]



lib::Net::DNS::UserlContributed Perl Dolib::Net::DNS::Resolver(3)

NAME
       Net::DNS::Resolver - DNS resolver class

SYNOPSIS
       use Net::DNS::Resolver;

DESCRIPTION
       Instances of the Net::DNS::Resolver class represent
       resolver objects.  A program can have multiple resolver
       objects, each maintaining its own state information such
       as the nameservers to be queried, whether recursion is
       desired, etc.

       Resolver configuration is read from the following files,
       in the order indicated:

	   /etc/resolv.conf
	   $HOME/.resolv.conf
	   ./.resolv.conf

       The following keywords are recognized in resolver
       configuration files:

       domain
	   The default domain.

       search
	   A space-separated list of domains to put in the search
	   list.

       nameserver
	   A space-separated list of nameservers to query.

       Files except for /etc/resolv.conf must be owned by the
       effective userid running the program or they won't be
       read.  In addition, several environment variables can also
       contain configuration information; see the ENVIRONMENT
       entry elsewhere in this document.

METHODS
       new

	   $res = new Net::DNS::Resolver;

       Creates a new DNS resolver object.

       print

	   $res->print;

       Prints the resolver state on the standard output.

24/Aug/1997	       perl 5.005, patch 03			1

lib::Net::DNS::UserlContributed Perl Dolib::Net::DNS::Resolver(3)

       string

	   print $res->string;

       Returns a string representation of the resolver state.

       searchlist

	   @searchlist = $res->searchlist;
	   $res->searchlist("foo.com", "bar.com", "baz.org");

       Gets or sets the resolver search list.

       nameservers

	   @nameservers = $res->nameservers;
	   $res->nameservers("192.168.1.1", "192.168.2.2", "192.168.3.3");

       Gets or sets the nameservers to be queried.

       port

	   print "sending queries to port ", $res->port, "\n";
	   $res->port(9732);

       Gets or sets the port to which we send queries.	This can
       be useful for testing a nameserver running on a non-
       standard port.  The default is port 53.

       search

	   $packet = $res->search("mailhost");
	   $packet = $res->search("mailhost.foo.com");
	   $packet = $res->search("192.168.1.1");
	   $packet = $res->search("foo.com", "MX");
	   $packet = $res->search("user.passwd.foo.com", "TXT", "HS");

       Performs a DNS query for the given name, applying the
       searchlist if appropriate.  The search algorithm is as
       follows:

       1.  If the name contains at least one dot, try it as is.

       2.  If the name doesn't end in a dot then append each item
	   in the search list to the name.  This is only done if
	   dnsrch is true.

       3.  If the name doesn't contain any dots, try it as is.

24/Aug/1997	       perl 5.005, patch 03			2

lib::Net::DNS::UserlContributed Perl Dolib::Net::DNS::Resolver(3)

       The record type and class can be omitted; they default to
       A and IN.  If the name looks like an IP address (4 dot-
       separated numbers), then an appropriate PTR query will be
       performed.

       Returns a Net::DNS::Packet object, or undef if no answers
       were found.

       query

	   $packet = $res->query("mailhost");
	   $packet = $res->query("mailhost.foo.com");
	   $packet = $res->query("192.168.1.1");
	   $packet = $res->query("foo.com", "MX");
	   $packet = $res->query("user.passwd.foo.com", "TXT", "HS");

       Performs a DNS query for the given name; the search list
       is not applied.	If the name doesn't contain any dots and
       defnames is true then the default domain will be appended.

       The record type and class can be omitted; they default to
       A and IN.  If the name looks like an IP address (4 dot-
       separated numbers), then an appropriate PTR query will be
       performed.

       Returns a Net::DNS::Packet object, or undef if no answers
       were found.

       send

	   $packet = $res->send($packet_object);
	   $packet = $res->send("mailhost.foo.com");
	   $packet = $res->send("foo.com", "MX");
	   $packet = $res->send("user.passwd.foo.com", "TXT", "HS");

       Performs a DNS query for the given name.	 Neither the
       searchlist nor the default domain will be appended.

       The argument list can be either a Net::DNS::Packet object
       or a list of strings.  The record type and class can be
       omitted; they default to A and IN.  If the name looks like
       an IP address (4 dot-separated numbers), then an
       appropriate PTR query will be performed.

       Returns a Net::DNS::Packet object whether there were any
       answers or not.	Use $packet->header->ancount or
       $packet->answer to find out if there were any records in
       the answer section.  Returns undef if there was an error.

24/Aug/1997	       perl 5.005, patch 03			3

lib::Net::DNS::UserlContributed Perl Dolib::Net::DNS::Resolver(3)

       bgsend

	   $socket = $res->bgsend($packet_object);
	   $socket = $res->bgsend("mailhost.foo.com");
	   $socket = $res->bgsend("foo.com", "MX");
	   $socket = $res->bgsend("user.passwd.foo.com", "TXT", "HS");

       Performs a background DNS query for the given name, i.e.,
       sends a query packet to the first nameserver listed in
       $res->nameservers and returns immediately without waiting
       for a response.	The program can then perform other tasks
       while waiting for a response from the nameserver.

       The argument list can be either a Net::DNS::Packet object
       or a list of strings.  The record type and class can be
       omitted; they default to A and IN.  If the name looks like
       an IP address (4 dot-separated numbers), then an
       appropriate PTR query will be performed.

       Returns an IO::Socket object.  The program must determine
       when the socket is ready for reading and call $res->bgread
       to get the response packet.  You can use $res->bgisready
       to find out if the socket is ready, or you can use vec and
       the socket's fileno method to add the socket's file
       descriptor to a bitmask for select.

       bgread

	   $packet = $res->bgread($socket);

       Reads the answer from a background query (see the bgsend
       entry elsewhere in this document).  The argument is an
       IO::Socket object returned by bgsend.

       Returns a Net::DNS::Packet object or undef on error.

       bgisready

	   $socket = $res->bgsend("foo.bar.com");
	   until ($res->bgisready($socket)) {
	       # do some other processing
	   }
	   $packet = $res->bgread($socket);

       Determines whether a socket is ready for reading.  The
       argument is an IO::Socket object returned by $res->bgsend.

       Returns true if the socket is ready, false if not.

24/Aug/1997	       perl 5.005, patch 03			4

lib::Net::DNS::UserlContributed Perl Dolib::Net::DNS::Resolver(3)

       axfr

	   @zone = $res->axfr("foo.com");
	   @zone = $res->axfr("passwd.foo.com", "HS");

       Performs a zone transfer from the first nameserver listed
       in nameservers.	The record class can be omitted; it
       defaults to IN.

       Returns a list of Net::DNS::RR objects, or undef if the
       zone transfer failed.

       The redundant SOA record that terminates the zone transfer
       is not returned to the caller.

       retrans

	   print "retrans interval", $res->retrans, "\n";
	   $res->retrans(3);

       Get or set the retransmission interval.	The default is 5.

       retry

	   print "number of tries: ", $res->retry, "\n";
	   $res->retry(2);

       Get or set the number of times to try the query.	 The
       default is 4.

       recurse

	   print "recursion flag: ", $res->recurse, "\n";
	   $res->recurse(0);

       Get or set the recursion flag.  If this is true,
       nameservers will be requested to perform a recursive
       query.  The default is true.

       defnames

	   print "defnames flag: ", $res->defnames, "\n";
	   $res->defnames(0);

       Get or set the defnames flag.  If this is true, calls to
       query will append the default domain to names that contain
       no dots.	 The default is true.

24/Aug/1997	       perl 5.005, patch 03			5

lib::Net::DNS::UserlContributed Perl Dolib::Net::DNS::Resolver(3)

       dnsrch

	   print "dnsrch flag: ", $res->dnsrch, "\n";
	   $res->dnsrch(0);

       Get or set the dnsrch flag.  If this is true, calls to
       search will apply the search list.  The default is true.

       debug

	   print "debug flag: ", $res->debug, "\n";
	   $res->debug(1);

       Get or set the debug flag.  If set, calls to search,
       query, and send will print debugging information on the
       standard output.	 The default is false.

       usevc (not yet implemented)

	   print "usevc flag: ", $res->usevc, "\n";
	   $res->usevc(1);

       Get or set the usevc flag.  If true, then queries will be
       performed using virtual circuits (TCP) instead of
       datagrams (UDP).	 The default is false.

       igntc (not yet implemented)

	   print "igntc flag: ", $res->igntc, "\n";
	   $res->igntc(1);

       Get or set the igntc flag.  If true, truncated packets
       will be ignored.	 If false, truncated packets will cause
       the query to be retried using TCP.  The default is false.

       errorstring

	   print "query status: ", $res->errorstring, "\n";

       Returns a string containing the status of the most recent
       query.

       answerfrom

	   print "last answer was from: ", $res->answerfrom, "\n";

       Returns the IP address from which we received the last
       answer in response to a query.

24/Aug/1997	       perl 5.005, patch 03			6

lib::Net::DNS::UserlContributed Perl Dolib::Net::DNS::Resolver(3)

       answersize

	   print "size of last answer: ", $res->answersize, "\n";

       Returns the size in bytes of the last answer we received
       in response to a query.

ENVIRONMENT
       The following environment variables can also be used to
       configure the resolver:

       RES_NAMESERVERS

	   # Bourne Shell
	   RES_NAMESERVERS="192.168.1.1 192.168.2.2 192.168.3.3"
	   export RES_NAMESERVERS

	   # C Shell
	   setenv RES_NAMESERVERS "192.168.1.1 192.168.2.2 192.168.3.3"

       A space-separated list of nameservers to query.

       RES_SEARCHLIST

	   # Bourne Shell
	   RES_SEARCHLIST="foo.com bar.com baz.org"
	   export RES_SEARCHLIST

	   # C Shell
	   setenv RES_SEARCHLIST "foo.com bar.com baz.org"

       A space-separated list of domains to put in the search
       list.

       LOCALDOMAIN

	   # Bourne Shell
	   LOCALDOMAIN=foo.com
	   export LOCALDOMAIN

	   # C Shell
	   setenv LOCALDOMAIN foo.com

       The default domain.

       RES_OPTIONS

24/Aug/1997	       perl 5.005, patch 03			7

lib::Net::DNS::UserlContributed Perl Dolib::Net::DNS::Resolver(3)

	   # Bourne Shell
	   RES_OPTIONS="retrans:3 retry:2 debug"
	   export RES_OPTIONS

	   # C Shell
	   setenv RES_OPTIONS "retrans:3 retry:2 debug"

       A space-separated list of resolver options to set.
       Options that take values are specified as option:value.

BUGS
       TCP queries are not yet implemented.

       Error reporting needs to be improved.

COPYRIGHT
       Copyright (c) 1997 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.

SEE ALSO
       the perl(1) manpage, the Net::DNS manpage, the
       Net::DNS::Packet manpage, the Net::DNS::Update manpage,
       the Net::DNS::Header manpage, the Net::DNS::Question
       manpage, the Net::DNS::RR manpage, the resolver(5)
       manpage, RFC 1035, RFC 1034 Section 4.3.5

24/Aug/1997	       perl 5.005, patch 03			8

lib::Net::DNS::UserlContributed Perl Dolib::Net::DNS::Resolver(3)

24/Aug/1997	       perl 5.005, patch 03			9

[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server BSDOS

List of man pages available for BSDOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net