Created
April 3, 2018 21:42
-
-
Save ptitoliv/09f327aaf51a5c89193120330a29a36f to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
import dns.resolver | |
main_domain = "mail-out.ovh.net." | |
cur_mailout=1 | |
while True: | |
try: | |
mail_out_answer = dns.resolver.query('mo' + str(cur_mailout) + '.' + main_domain,'A') | |
except dns.resolver.NXDOMAIN: | |
break | |
for cur_answer in mail_out_answer: | |
# Let's do the same with "sub mailout" (x.moY.mail-out.ovh.net) | |
print(cur_answer) | |
cur_sub_mailout=1 | |
while True: | |
try: | |
sub_mail_out_answer = dns.resolver.query(str(cur_sub_mailout) + '.mo' + str(cur_mailout) + '.' + main_domain,'A') | |
except dns.resolver.NXDOMAIN: | |
break | |
for cur_sub_answer in sub_mail_out_answer: | |
print(cur_sub_answer) | |
cur_sub_mailout = cur_sub_mailout + 1 | |
cur_mailout = cur_mailout + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment