如果我有一个用于FQDN的IP地址,则下面的代码可以正常工作。
import socket
addr1 = socket.gethostbyname('test.cloud.net')
print (addr1)
如果我有两个用于FQDN的IP地址。如何通过bove代码获取两个IP地址?
nsloolup test.cloud.net
Server: 10.1.10.10
Address: 10.1.10.10#85
Non-authoritative answer:
test.cloud.net canonical name = test.cloud.net.aws.com.
Name: test1.aws.com
Address: 10.10.1.20
Name: test1.aws.com
Address: 10.10.1.21