Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Aug 2014 21:28:42 -0400
From:      "Dave Stoddard" <dgs@accelix.net>
To:        <christophe@labouisse.org>
Cc:        ports@FreeBSD.org
Subject:   FreeBSD Port: jdresolve-0.6.1_1
Message-ID:  <046a01cfb2a8$17a9d650$46fd82f0$@net>

next in thread | raw e-mail | index | archive | help
I installed the jdresolve port on FreeBSD 10.0-RELEASE-p6 using
Perl 5.16.3 and Net::DNS version 0.78 (the latest version as of
8/07/2014).

When I ran jdresolve against my Apache log file, I was getting
the string "Net::DNS::DomainName1035=HASH(0x805788a08)" instead
of the host names I was expecting.  This is indicative of a
hash dereferencing error that is occurring due to changes in
the Net::DNS Perl modules.

I traced the problem in jdresolve to line 867, which contained
the following code:

$hosts{$query}{NAME} = $_->{ptrdname};

The $_ object is a Net:DNS:RR object, and ptrdname is a hash
reference containing a number of items.  That reference contains
a reference to another hash called label, which contains a reference
to an array that has the individual name segments of the host name.
For example, if we were resolving the FreeBSD web server's IP address,
the array would contain the following items:

www
freebsd
org

These segments needs to be assembled into a complete host name
for use by jdresolve.  The fix is to replace the old line of code
with this line of code:

$hosts{$query}{NAME} = join(".",@{$_->{ptrdname}->{label}});

This corrects the name resolution error in jdresolve.  You can test
this fix by obtaining a copy of an Apache log file and running the
following test:

jdresolve access.log > replacement.log

The replacement.log file will contain proper host names instead
of IP addresses.  Just thought you might want to know.
Best,

Dave Stoddard
dgs at accelix.net
301-455-0245 : cell





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?046a01cfb2a8$17a9d650$46fd82f0$>