QNX Developer Support
|This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.|
Hostname database (UNIX)
The /etc/hosts file contains information regarding the known hosts on the network. For each host, a single line should be present with the following information:
internet_address official_host_name aliases
Items are separated by any number of spaces or tabs, or both; however, spaces or tabs aren't allowed before the IP address. A # indicates the beginning of a comment -- any characters after a #, up to the end of the line, aren't interpreted by routines that search the file.
If you're using a name server, this file provides a backup when the server isn't running. In this case, you should include only a few addresses in this file. These include addresses for the local interfaces that ifconfig needs at boot time and a few machines on the local network.
Network addresses are specified in the conventional "." (dot) notation using the inet_addr() routine from the internet address manipulation functions. Hostnames may contain any printable character other than a field delimiter, newline, or comment character.
gethostname() in the Library Reference
DNS and BIND by Paul Albitz and Cricket Liu, O'Reilly & Associates (ISBN 1-56592-010-4)