Created
May 2, 2015 05:13
-
-
Save davexpro/a70383f3e7c21f82d32e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/user/bom/env python | |
# coding=utf8 | |
# [email protected] | |
# create=20150502 | |
__author__ = 'Dave' | |
import dns.resolver | |
def get_dns_a(domain): | |
print "[+] A Records" | |
A = dns.resolver.query(domain, 'A') | |
for i in A.response.answer: | |
for j in i.items: | |
if j.rdtype == 1: | |
print j.address | |
else: | |
pass | |
def get_dns_ns(domain): | |
print "[+] NS Records" | |
NS = dns.resolver.query(domain, 'NS') | |
for i in NS.response.answer: | |
for j in i.items: | |
print j | |
if __name__ == '__main__': | |
domain = raw_input('please input an domain:') | |
get_dns_a(domain) | |
get_dns_ns(domain) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment