mirror of
https://github.com/simple-login/app.git
synced 2024-11-13 07:31:12 +01:00
13 lines
314 B
Python
13 lines
314 B
Python
import dns.resolver
|
|
|
|
|
|
def get_mx_domains(hostname) -> [str]:
|
|
answers = dns.resolver.query(hostname, "MX")
|
|
ret = []
|
|
|
|
for a in answers:
|
|
record = a.to_text() # for ex '20 alt2.aspmx.l.google.com.'
|
|
r = record.split(" ")[1] # alt2.aspmx.l.google.com.
|
|
ret.append(r)
|
|
|
|
return ret
|