#!/usr/bin/perl
use strict;
use warnings;
use feature 'say';
use Net::Domain qw( hostfqdn hostdomain );
if (my $hostdomain = hostdomain) {
say $hostdomain;
}
else {
my $hostfqdn = hostfqdn;
say $hostfqdn;
}
Where you can get use the hostfqdn() method and you can identify and return the FQDN of the current host. By doing so you will get all public information at least. You can read more at the documentation Net::Domain.
Hope this helps, BR.
Seeking for Perl wisdom...on the process of learning...not there...yet!
|