perl

用perl来查询网站ip地址

发布于 2023-03-06约 1 分钟阅读
#!/usr/bin/perl

use Socket;

my $host = "www.biocloudservice.com";
my $ip = inet_ntoa(scalar gethostbyname($host || 'localhost'));

print "The IP address of $host is: $ip\n";
遇到问题?

通过技术支持工单描述环境、操作步骤和报错信息,我们会更快定位问题。

提交技术工单