-
Notifications
You must be signed in to change notification settings - Fork 10
/
dns-enumeration.py
23 lines (22 loc) · 857 Bytes
/
dns-enumeration.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import dns.resolver
# Set the target domain and record type
print ('''\033[93m
**********************************************
* Simple DNS Enumeration Tool *
* github page : https://github.com/r3dhulk *
**********************************************
''')
target_domain = input("\033[92m [*] Hulk Wants The URL: ")
record_types = ["A", "AAAA", "CNAME", "MX", "NS", "SOA", "TXT"]
# Create a DNS resolver
resolver = dns.resolver.Resolver()
for record_type in record_types:
# Perform DNS lookup for the specified domain and record type
try:
answers = resolver.resolve(target_domain, record_type)
except dns.resolver.NoAnswer:
continue
# Print the answers
print(f"{record_type} records for {target_domain}:")
for rdata in answers:
print(f" {rdata}")