import socket result = socket.getaddrinfo("www.jd.com", None) print(result[0][4][0]) 结果:111.206.231.1