Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

What is the proper way to determine a host's fqdn(fully qualified domain name)? Is it possible to only use system calls in doing so?(ie gethostbyaadr, gethostbyname). I want the host to resolve its fqdn for me through its resolving mech. instead of having to query name services myself from the script. Any help would be appreciated.

Replies are listed 'Best First'.
Re: damn frustrating FQDN problem
by greenFox (Vicar) on Mar 08, 2002 at 05:06 UTC
    One solution-
    use Net::Domain
    use Net::Domain qw(hostfqdn); my $fqdn = hostfqdn ();
    hostfqdn () - Identify and return the FQDN of the current host.

    --
    my $chainsaw = 'Perl';