IPB
>  Man Pages > Unix > Solaris 10 11/06 > Section 4 > hosts man page

hosts man page

Section 4 - Solaris 10 11/06 Man Pages

Other operating system man pages available here


Advanced Search

Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!





File Formats                                             hosts(4)



NAME
     hosts - host name database

SYNOPSIS
     /etc/inet/hosts

     /etc/hosts

DESCRIPTION
     The hosts file is a local database that associates the names
     of  hosts  with  their Internet Protocol (IP) addresses. The
     hosts file can be used in conjunction with, or  instead  of,
     other  hosts  databases,  including  the  Domain Name System
     (DNS), the NIS hosts map, the NIS+ hosts table, or  informa-
     tion from an LDAP server. Programs use library interfaces to
     access information in the hosts file.

     The hosts file has one entry for each  IP  address  of  each
     host.  If  a host has more than one IP address, it will have
     one entry for each, on consecutive lines. The format of each
     line is:

          IP-address official-host-name nicknames...


     Items are separated by any number of SPACE and/or TAB  char-
     acters.  The  first item on a line is the host's IP address.
     The second entry is the  host's  official  name.  Subsequent
     entries  on the same line are alternative names for the same
     machine, or "nicknames." Nicknames are optional.

     For a host  with  more  than  one  IP  address,  consecutive
     entries  for these addresses may contain the same or differ-
     ing nicknames. Different nicknames are useful for  assigning
     distinct names to different addresses.

     A call to gethostbyname(3NSL) returns  a  hostent  structure
     containing  the  union  of  all addresses and nicknames from
     each line containing a matching official name or nickname.

     A `#' indicates the beginning of a comment; characters up to
     the  end  of  the  line are not interpreted by routines that
     search the file.

     Network addresses are written in the  conventional  "decimal
     dot"  notation  and  interpreted using the inet_addr routine
     from   the   Internet    address    manipulation    library,
     inet(3SOCKET).

     This interface supports host names as  defined  in  Internet
     RFC 952 which states:




SunOS 5.10          Last change: 30 Sep 2005                    1






File Formats                                             hosts(4)



          A "name" (Net, Host, Gateway, or Domain name) is a text
          string  up to 24 characters drawn from the alphabet (A-
          Z), digits (0-9), minus sign (-), and period (.).  Note
          that  periods  are only allowed when they serve to del-
          imit components of "domain style names".  (See RFC 921,
          "Domain Name System Implementation Schedule," for back-
          ground). No blank or space characters are permitted  as
          part  of  a name. No distinction is made between upper-
          case and lowercase. The  first  character  must  be  an
          alpha  character  [or  a  digit.  (RFC 1123 relaxed RFC
          952's limitation of the first character to  only  alpha
          characters.)]  The  last  character must not be a minus
          sign or period.

     Host names must not consist of numbers  only.  A  host  name
     must contain at least one alphabetical or special character.

     Although the interface accepts host  names  longer  than  24
     characters  for  the  host  portion (exclusive of the domain
     component), choosing names for hosts that adhere to  the  24
     character  restriction  will insure maximum interoperability
     on the Internet.

     A host which serves as a GATEWAY should have  "-GATEWAY"  or
     "-GW"  as  part  of  its  name.  Hosts which do not serve as
     Internet gateways should not use  "-GATEWAY"  and  "-GW"  as
     part  of  their  names.  A  host  which is a TAC should have
     "-TAC" as the last part of its host name, if  it  is  a  DoD
     host. Single character names or nicknames are not allowed.

EXAMPLES
     Example 1: Example of a typical line from the hosts file.

     Here is a typical line from the hosts file:

     192.9.1.20        gaia                        # John Smith

SEE ALSO
     gethostbyname(3NSL),    inet(3SOCKET),     nsswitch.conf(4),
     resolv.conf(4)

NOTES
     /etc/inet/hosts is the official SVR4 name of the hosts file.
     The symbolic link /etc/hosts exists for BSD compatibility.











SunOS 5.10          Last change: 30 Sep 2005                    2





Man(1) output converted with man2html and wrapped by fishsponge

This page was generated on Wed Sep 12 11:27:24 GMT 2007

Your favourite pages:

No pages logged yet.
Trying to save cookie...

Top 10 most popular pages:

sqlite3 man page (5334 hits)
(openSUSE 10.2)

svn man page (5208 hits)
(FreeBSD 6.2)

adv_cap_autoneg man page (4870 hits)
(Solaris 10 11_06)

CPAN man page (4607 hits)
(Suse Linux 10.1)

ssh man page (4342 hits)
(Suse Linux 10.1)

ssh-socks5-proxy-connect man page (2876 hits)
(Solaris 10 11_06)

netcat man page (2717 hits)
(Suse Linux 10.1)

pprosetup man page (2487 hits)
(Solaris 10 11_06)

startproc man page (2471 hits)
(Suse Linux 10.1)

signal man page (2407 hits)
(Suse Linux 10.1)

Useful Links

Go Back

Visitor Statistics


Valid XHTML 1.0 Transitional     Valid CSS!

Partners: Cambridge Plus :: Pyrenees Mountain Holidays Contact Us :: PIC Project Development :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum