diff --git a/waccess b/waccess index 294fa17..66f4f09 100755 --- a/waccess +++ b/waccess @@ -1,6 +1,6 @@ #!/usr/bin/env python # waccess - Copyright (c) 2001,2002, TundraWare Inc., All Rights Reserved -# $Id: waccess,v 1.61 2002/08/31 06:11:56 tundra Exp $ +# $Id: waccess,v 1.62 2002/09/02 06:24:08 tundra Exp $ # # Look for selected strings passed on the command line in the http access log. @@ -30,6 +30,13 @@ IGNORED = ["127.0", "192.168.0."] +# This table is built dynamically at run time to keep track of +# any DNS that cannot be reverse. That way we only have to +# waste lookup time on such an address the first time it is +# encountered. + +BADREVERSE = [] + ########## # Function Defintions @@ -112,8 +119,12 @@ if MATCHED: if REVERSE: try: - revname = socket.gethostbyaddr(fields[0])[0] + if not BADREVERSE.count(fields[0]): + revname = socket.gethostbyaddr(fields[0])[0] + else: + revname = "NO REVERSE RESOLUTION" except: + BADREVERSE.append(fields[0]) revname = "NO REVERSE RESOLUTION" if SHOW: @@ -130,6 +141,3 @@ print "Found %d Matching Records Containing: %s" % (matched[a], a) - - -