#! /usr/bin/perl -w
use strict;
use Socket;
use Sys::Hostname;
my $host = hostname;#output the host name;
print "Host name: ",$host,"/n";
my $name = gethostbyname($host);
my $ip_addr = inet_ntoa($name);
print $ip_addr,"/n";
print "get the ip of www.csdn.net/n";
my $remoteHost = gethostbyname("www.csdn.net");
my $remote_ip = inet_ntoa($remoteHost);
print $remote_ip,"/n";