PyDNS& DNS超时错误

问题描述:

根据 validate_email 1.3:Python包索引,为了检查域 mx 并验证电子邮件退出,我必须具有 pyDNS 包安装。

Per validate_email 1.3 : Python Package Index, in order to check the domain mx and verify email exits, I must have the pyDNS package installed.

如何设置自己的名字服务(DNS)而不是系统,因为我得到超时,否则...

How do I set my own name service (DNS) instead of system one as I'm getting timeout otherwise...

以下是将DNS服务器设置为例如 Google的公共DNS服务器

Here is how you would set your DNS server to, for example, Google's public DNS server:

from validate_email import validate_email
import DNS
DNS.defaults['server']=['8.8.8.8', '8.8.4.4']

print validate_email('rob@example.com', check_mx=True)