[stunnel-users] Reverse DNS lookup in stunnel log possible?

Michael D. Setzer II mikes at kuentos.guam.net
Sat Jul 27 00:34:32 CEST 2013

On 26 Jul 2013 at 14:47, mkanet at yahoo.com wrote:

Date sent:	Fri, 26 Jul 2013 14:47:18 -0700 (PDT)
From:	"mkanet at yahoo.com" <mkanet at yahoo.com>
To:	"stunnel-users at stunnel.org" <stunnel-users at stunnel.org>
Subject:	Re: [stunnel-users] Reverse DNS lookup in stunnel log possible?
Send reply to:	"mkanet at yahoo.com" <mkanet at yahoo.com>
	patches" <stunnel-users.stunnel.org>
	<mailto:stunnel-users-request at stunnel.org?subject=unsubscribe>
	<mailto:stunnel-users-request at stunnel.org?subject=subscribe>

> Thanks, I guess I could do the equivalent with a batch file; but, was
> really hoping for buitin support for this in stunnel.  It would be
> nice to see in the upcoming 5.00 release as an option.
> -----------------

You could also just copy the stunnel.log file to a linux system to 
do the processing, or perhaps use windows unix/linux commands.

Modified version that now will actually add the name to each line
Added filtering out 127.0.0 and 192.168 changes and now creates 
the file stunnelx.org that will have all the additions. Does end up 
with the :port afterwards, but that is minor.

First line does wrap.
grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' /var/log/stunnel.log | sort | uniq 
| grep -v 127.0.0 | grep -v 192.168. >stout

echo -n "" >stout2
echo -n "" >stout2x
for a in `cat stout` ; do 
  echo -n $a " ">>stout2; 
  echo -n "s/"$a"/"$a" " >>stout2x;
  host $a | awk '{print $5}' >>stout2; 
  host $a | awk '{print $5"/g"}' >>stout2x; 
sed -f stout2x /var/log/stunnel.log >stunnelx.log

  Michael D. Setzer II -  Computer Science Instructor      
  Guam Community College  Computer Center                  
  mailto:mikes at kuentos.guam.net                            
  mailto:msetzerii at gmail.com
  Guam - Where America's Day Begins                        
  G4L Disk Imaging Project maintainer 

http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned:  19,471
Processing time:  32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)

SETI        15540600.945971   |   EINSTEIN    12495097.479852
ROSETTA      8051875.704643   |   ABC         16197684.012277

More information about the stunnel-users mailing list