Use socket.gethostbyname.

This commit is contained in:
voussoir 2021-11-14 15:42:30 -08:00
parent a9acab1764
commit d8d7807280
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

2
dns.py
View file

@ -2,4 +2,4 @@ import socket
import sys
domain = sys.argv[1]
print(socket.getaddrinfo(domain, 53)[0][4][0])
print(socket.gethostbyname(domain))