-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdns_modules.py
35 lines (29 loc) · 914 Bytes
/
dns_modules.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#-------------------------------------------------------------------------------
# Name: DNS_modules
# Purpose:
#
# Author: [email protected]
#
# Created: 05/31/2014
#-------------------------------------------------------------------------------
import os
import sys
import tools
import module_locater
import dns.resolver
import datetime
scriptdir = module_locater.module_path()
myDate = datetime.datetime.now().strftime("%y-%m-%d")
myTime = datetime.datetime.now().strftime("%H%M")
myDateTime = datetime.datetime.now().strftime("%y-%m-%d %H%M")
resultsdir = scriptdir + '\\Results\\'
if not os.path.exists(resultsdir):
os.makedirs(resultsdir)
def DNS(host, recordtype):
answers = dns.resolver.query(host, recordtype)
for rdata in answers:
print('Host', rdata.exchange, 'has preference', rdata.preference)
def main():
pass
if __name__ == '__main__':
main()