3 # Author: Tim Riker <Tim@Rikers.org>
4 # Source: extracted from UserExtra.pl
5 # Licensing: Artistic License (as perl itself)
8 # Copyright (c) 2005 Tim Riker
17 my ( $match, $x, $y, $result, $pid );
19 if ( $dns =~ /(\d+\.\d+\.\d+\.\d+)/ ) {
22 &::status("DNS query by IP address: $dns");
24 $y = pack( 'C4', split( /\./, $dns ) );
25 $x = ( gethostbyaddr( $y, &AF_INET ) );
27 if ( $x !~ /^\s*$/ ) {
28 $result = "$dns is $x" unless ( $x =~ /^\s*$/ );
31 $result = "I can't find the address $dns in DNS";
37 &::status("DNS query by name: $dns");
38 $x = join( '.', unpack( 'C4', ( gethostbyname($dns) )[4] ) );
40 if ( $x !~ /^\s*$/ ) {
41 $result = "$dns is $x";
44 $result = "I can't find $dns in DNS";
52 &::performStrictReply( &dns(@_) );
58 # vim:ts=4:sw=4:expandtab:tw=80