[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 3

mkhosts Command

Purpose

Generates the host table file.

Syntax

/usr/sbin/mkhosts-v ] HostFile

Description

The mkhosts command can be used to generate a hashed host database, using the filename specified by the HostFile parameter. It is not used if name resolution is performed by the named daemon. The host file is usually the /etc/hosts file, and in any case must be in the same format as the /etc/hosts file.

The mkhosts command generates database files named hostfile.pag and hostfile.dir. Updates to these files are built in a set of temporary files named hostfile.new.pag and hostfile.new.dir. The temporary files are copied into the database files only if the hostfile.new.pag and hostfile.new.dir files are built without errors.

The host file is used by one version of the gethostbyaddr and gethostbyname library routines for name resolution.

Note: The AIX version of the gethostbyaddr and gethostbyname library routines does not support the hostfile.pag and hostfile.dir files.

After creating the host file, you can edit it to include the desired host entries.

Flags

-v Lists each host as it is added to the host file specified by the HostFile parameter.

Examples

Use the following command to generate the /etc/hosts.pag and /etc/hosts.dir files:

mkhosts /etc/hosts

This command creates two host files called /etc/hosts.pag and /etc/hosts.dir.

Files

hostfile.pag One of two files containing the real database for name resolution.
hostfile.dir One of two files containing the real database for name resolution.
hostfile.new.pag One of two files containing the temporary database for name resolution.
hostfile.new.dir One of two files containing the temporary database for name resolution.

Related Information

The gettable command, htable command.

The named daemon.

The gethostbyname subroutine, gethostbyaddr subroutine.

The hosts file format.

Naming in AIX Version 4.3 System Management Guide: Communications and Networks.


[ Previous | Next | Contents | Glossary | Home | Search ]