Middleware, development tools, realtime operating system
software and services for superior embedded design


Home
QNX Community Resources
Developer Support
QNX Documentation Library
QNX Developer Support

QNX Developer Support

QNX Software Systems
Developer Resources
Blogs
Board support packages
Foundry27 projects
Forums
Hardware support listing
Online video tutorials
Product documentation
Technical Articles

[Previous] [Contents] [Index] [Next]

/etc/hosts

Hostname database (UNIX)

Name:

/etc/hosts

Description:

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.

See also:

ifconfig

gethostname() in the Library Reference

DNS and BIND by Paul Albitz and Cricket Liu, O'Reilly & Associates (ISBN 1-56592-010-4)


[Previous] [Contents] [Index] [Next]