WPAD now integrated

This commit is contained in:
byt3bl33d3r 2014-12-13 21:30:55 +01:00
commit d01398d8a8
13 changed files with 82 additions and 39 deletions

View file

@ -1,3 +1,4 @@
import logging
class DnsCache:
@ -8,6 +9,7 @@ class DnsCache:
_instance = None
def __init__(self):
self.customAddress = None
self.cache = {}
def cacheResolution(self, host, address):
@ -25,4 +27,15 @@ class DnsCache:
return DnsCache._instance
getInstance = staticmethod(getInstance)
def setCustomRes(self, host, ip_address=None):
if ip_address is not None:
self.cache[host] = ip_address
logging.debug("DNS entry set: %s -> %s" %(host, ip_address))
else:
if self.customAddress is not None:
self.cache[host] = self.customAddress
def setCustomAddress(self, ip_address):
self.customAddress = ip_address
getInstance = staticmethod(getInstance)