Thread IP-Adr ermitteln (aber nicht localhost) (28 answers)
Opened by roli at 2014-12-28 19:07

GwenDragon
 2015-12-29 13:32
#178954 #178954
User since
2005-01-17
14598 Artikel
Admin1
[Homepage]
user image
Schon Net::Domain und gethostbyname() ausprobiert?
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
use 5.010;
use Net::Domain qw(hostname hostfqdn hostdomain domainname);

say "hostname: ", hostname();
say "hostfqdn: ", hostfqdn();
say "hostdomain: ", hostdomain();
say "domainname: ", domainname();

my $host = hostfqdn() . '.';
use Socket;
my $addr = inet_ntoa(scalar(gethostbyname($host)));
print "Name= $host   IP Adr=$addr <\n";

View full thread IP-Adr ermitteln (aber nicht localhost)