GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SYS::HOSTNAME::FQDN (3)

.ds Aq ’

NAME



  Sys::Hostname::FQDN - Get the short or long hostname



CONTENTS

SYNOPSIS



  use Sys::Hostname::FQDN qw(
        asciihostinfo
        gethostinfo
        inet_ntoa
        inet_aton
        fqdn
        short
  );

  $host = short();
  $fqdn = fqdn();
  ($name,$aliases,$addrtype,$length,@addrs)=gethostinfo();
  ($name,$aliases,$addrtype,$length,@addrs)=asciihostinfo();
  $dotquad = inet_ntoa($netaddr);
  $netaddr = inet_aton($dotquad);



INSTALLATION

To install this module type the following:



  perl Makefile.PL
  make
  make test
  make install



Solaris users, see the ’hints’ subdirectory if you have problems with the build.

DESCRIPTION

<B>Sys::Hostname::FQDNB> uses the host ’C’ library to discover the (usually) short host name, then uses (perl) gethostbyname to extract the real hostname.

The results from gethostbyname are exported as <B>gethostinfoB> and <B>asciihostinfoB> as a convenience since they are available. Similarly, the ’C’ library functions <B>inet_ntoaB> and <B>inet_atonB> are exported.
$host = short();


  returns the host part of this hosts FQDN.



$fqdn = fqdn();


  returns the fully qualified host name of this host.



($name,$aliases,$addrtype,$length,@addrs)=gethostinfo();


  returns:
    $name       fully qualifed host name of this host.
    $aliases    alternate names for this host.
    $addrtype   The type of address; always AF_INET at present.
    $length     The length of the address in bytes.
    @addrs      array of network addresses for this host
                in network byte order.



($name,$aliases,$addrtype,$length,@addrs)=asciihostinfo();


  returns:
    $name       fully qualifed host name of this host.
    $aliases    alternate names for this host.
    $addrtype   The type of address; always AF_INET at present.
    $length     The length of the address in bytes.
    @addrs      array of dot quad IP addresses for this host.



$dotquad = inet_ntoa($netaddr);


  input:        packed network address in network byte order.
  returns:      dot quad IP address.



$netaddr = inet_aton($dotquad);


  input:        dot quad IP address.
  returns:      packed network address in network byte order.



DEPENDENCIES



  none



EXPORT



  None by default



EXPORT_OK



  asciihostinfo
  gethostinfo
  inet_ntoa
  inet_aton
  fqdn
  short



ACKNOWLEDGEMENTS

The workaround for systems that do not have ’inet_aton’ is taken directly from Socket.xs in the Perl 5 kit for perl-5.8.0 by Larry Wall, copyright 1989-2002. Thank you Larry for making PERL possible for all of us.

AUTHOR

Michael Robinton <michael@bizsystems.com>

COPYRIGHT AND LICENCE



  Copyright 2003-2010, Michael Robinton <michael@bizsystems.com>



This module is free software; you can redistribute it and/or modify it under the terms of either:



  a) the GNU General Public License as published by the Free Software
  Foundation; either version 1, or (at your option) any later version,
 
  or

  b) the "Artistic License" which comes with this module.



This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details.

You should have received a copy of the Artistic License with this module, in the file ARTISTIC. If not, I’ll be glad to provide one.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 FQDN (3) 2010-11-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.