mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-05-05 01:40:56 -05:00
SysDNS: allow passing a specific name server
This commit is contained in:
parent
9e59d7d0e0
commit
f3f1911d96
@ -48,8 +48,8 @@ class SysDNS(callbacks.Plugin):
|
|||||||
utility available on the host machine.
|
utility available on the host machine.
|
||||||
"""
|
"""
|
||||||
threaded = True
|
threaded = True
|
||||||
def dns(self, irc, msg, args, optlist, server):
|
def dns(self, irc, msg, args, optlist, target, nameserver):
|
||||||
"""[--type type] <host>
|
"""[--type type] <target host> [<name server>]
|
||||||
Looks up a DNS hostname using the 'host' binary available on the system. --type
|
Looks up a DNS hostname using the 'host' binary available on the system. --type
|
||||||
controls the type of record to look for. (A, AAAA, etc.)
|
controls the type of record to look for. (A, AAAA, etc.)
|
||||||
"""
|
"""
|
||||||
@ -62,9 +62,12 @@ class SysDNS(callbacks.Plugin):
|
|||||||
optlist = dict(optlist)
|
optlist = dict(optlist)
|
||||||
recordtype = optlist.get('type')
|
recordtype = optlist.get('type')
|
||||||
if recordtype:
|
if recordtype:
|
||||||
args = [cmd, '-t', dict(optlist)['type'], server]
|
args = [cmd, '-t', dict(optlist)['type'], target]
|
||||||
else:
|
else:
|
||||||
args = [cmd, server]
|
args = [cmd, target]
|
||||||
|
|
||||||
|
if nameserver:
|
||||||
|
args.append(nameserver)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(os.devnull) as null:
|
with open(os.devnull) as null:
|
||||||
@ -88,7 +91,8 @@ class SysDNS(callbacks.Plugin):
|
|||||||
irc.error('This domain exists, but no records of type %s were found.'
|
irc.error('This domain exists, but no records of type %s were found.'
|
||||||
% (recordtype or 'A/AAAA/MX'))
|
% (recordtype or 'A/AAAA/MX'))
|
||||||
|
|
||||||
dns = thread(wrap(dns, [getopts({'type':'something'}), 'somethingWithoutSpaces']))
|
dns = thread(wrap(dns, [getopts({'type':'something'}), 'somethingWithoutSpaces',
|
||||||
|
additional('somethingWithoutSpaces')]))
|
||||||
|
|
||||||
|
|
||||||
Class = SysDNS
|
Class = SysDNS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user