Skip to content

Commit

Permalink
Discover the dns server only once
Browse files Browse the repository at this point in the history
  • Loading branch information
cdevienne committed Apr 8, 2014
1 parent 892f864 commit 5599863
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion validate_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
try:
import DNS
ServerError = DNS.ServerError
DNS.DiscoverNameServers()
except ImportError:
DNS = None

Expand Down Expand Up @@ -123,7 +124,6 @@ def validate_email(email, check_mx=False, verify=False, debug=False, smtp_timeou
if not DNS:
raise Exception('For check the mx records or check if the email exists you must '
'have installed pyDNS python package')
DNS.DiscoverNameServers()
hostname = email[email.find('@') + 1:]
mx_hosts = get_mx_ip(hostname)
if mx_hosts is None:
Expand Down

0 comments on commit 5599863

Please sign in to comment.