Skip to content

Commit

Permalink
DNS Service added, listening on port 53 and resolving .bit
Browse files Browse the repository at this point in the history
  • Loading branch information
khalahan committed Jul 13, 2012
1 parent c1489e9 commit 45f98ff
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions plugin/pluginServiceDNS.py
@@ -0,0 +1,25 @@
import plugin
import dnsServer

class pluginServiceDNS(plugin.PluginThread):
name = 'dns'
options = {
'start': ['launch at startup', 1],
'host': ['listen on ip', '127.0.0.1'],
'port': ['listen on port', 53],
'resolver': ['forward standard requests to', '8.8.8.8,8.8.4.4']
}
srv = None

def pStart(self):
if self.srv is None:
self.srv = dnsServer.DnsServer()
self.srv.start(self.app)
return True

def pStop(self):
if self.srv is not None:
self.srv.stop()
print "Plugin %s stopped" %(self.name)
return True

0 comments on commit 45f98ff

Please sign in to comment.