What Python way would you suggest to check whois database records?

前端 未结 9 1046
忘掉有多难
忘掉有多难 2020-12-31 18:20

I\'m trying to get a webservice up and running that actually requires to check whois databases. What I\'m doing right now is ugly and I\'d like to avoid it as much as I can:

9条回答
  •  梦谈多话
    2020-12-31 18:39

    import socket
    socket.gethostbyname_ex('url.com')
    

    if it returns a gaierror you know know it's not registered with any DNS

提交回复
热议问题