perl实例代码:使用INET_NTOA和INET_ATON获取DNS的主机地址。
代码:
#!/bin/perl # use Socket;
$site_name = 'www.jb200.com';
$address = inet_ntoa(inet_aton($site_name));
print "The DNS address of www.jb200.com is $address";
CopyRight © 2010-2021 脚本学堂 Jb200.com , All Rights Reserved.