我使用socket.gethostbyaddr来获取域的ip,并且它不会给我任何结果,而ping和dig可以正确地返回IP。
>>> import socket
>>> socket.gethostbyaddr('supplychristianlouboutin.com')
Traceback (most recent call last):
File "<input>", line 1, in <module>
herror: [Errno 1] Unknown host
所以我觉得为什么这个API不可靠?这有什么建议吗?