| Net-DNS documentation | Contained in the Net-DNS distribution. |
Net::DNS::Resolver::UNIX - UNIX Resolver Class
use Net::DNS::Resolver;
This class implements the UNIX specific portions of Net::DNS::Resolver.
No user serviceable parts inside, see Net::DNS::Resolver for all your resolving needs.
Copyright (c) 1997-2002 Michael Fuhr.
Portions Copyright (c) 2002-2004 Chris Reinhardt.
All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
perl(1), Net::DNS, Net::DNS::Resolver
| Net-DNS documentation | Contained in the Net-DNS distribution. |
package Net::DNS::Resolver::UNIX; # # $Id: UNIX.pm 482 2005-09-02 13:34:33Z olaf $ # use strict; use vars qw(@ISA $VERSION); use Net::DNS::Resolver::Base (); @ISA = qw(Net::DNS::Resolver::Base); $VERSION = (qw$LastChangedRevision: 482 $)[1]; my $resolv_conf = '/etc/resolv.conf'; my $dotfile = '.resolv.conf'; my @config_path; push(@config_path, $ENV{'HOME'}) if exists $ENV{'HOME'}; push(@config_path, '.'); sub init { my ($class) = @_; $class->read_config_file($resolv_conf) if -f $resolv_conf && -r _; foreach my $dir (@config_path) { my $file = "$dir/$dotfile"; $class->read_config_file($file) if -f $file && -r _ && -o _; } $class->read_env; my $defaults = $class->defaults; if (!$defaults->{'domain'} && @{$defaults->{'searchlist'}}) { $defaults->{'domain'} = $defaults->{'searchlist'}[0]; } elsif (!@{$defaults->{'searchlist'}} && $defaults->{'domain'}) { $defaults->{'searchlist'} = [ $defaults->{'domain'} ]; } } 1; __END__