PyDNS & DNS timeout error

China☆狼群 提交于 2019-12-11 10:16:46

问题


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.

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


回答1:


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)


来源:https://stackoverflow.com/questions/35488288/pydns-dns-timeout-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!