Hosts files typically contain IP addresses, system names, system name aliases, and user comments. The hosts file that you create can contain additional information about systems. The information appears as one or more comments that precede the hosts file entry for the system. Unless other values are specified, the default values are used. Defaults are provided for the following parameters:
You can modify the hosts file to substitute a value for the defaults for one entry or change the default for all subsequent entries. To change values for a single system entry in a hosts file, add a statement to the hosts file as a comment on the line before the host entry as shown in the following example. The statement applies to the system it precedes and only to that system. In the following example, the default TYPE is changed to server for the system EngProliant.
To change the default globally so it affects the next file entry and all subsequent entries, use a statement as shown in the following example. The default is changed to router for the next entry. Router remains the default for all entries until another #$IMXE_DEFAULT statement changes the value. If a single instance of TYPE is changed by a #$IMXE statement, the default is not used for only the next entry and then reverts to router.
The following text quoted from a hosts file illustrates several statements. The explanations, which begin with the pound sign (#), are not displayed in the hosts file.
# Title: Systems in database
# Sorted by: IP address
# Date: 28-Mar-00 2:29:31 PM
# Author: administrator
The system EngProliant uses all current defaults. There are no
additional comments.
16.26.176.92 EngProliant.compaq.com EngProliant #user comments
The system testServer in the following example defaults for TYPE.
The defaults for SNMP Timeouts and Retries were
restored for this system but only apply to testServer. The SNMP
write community string default was changed and only applies
to testServer.
#$IMXE: TYPE=Server
#$IMXE: SNMP_TIM=0 SNMP_RET=0 SNMP_MON=public
SNMP_CON=private
16.26.160.20 testServer.compaq.com testServer
All defaults in the following example for the system BldRtr1 are
the same as for testServer, but had to be specified because
they are not the global defaults. These changes apply only to
BldRtr1.
#$IMXE: TYPE=Router
#$IMXE: SNMP_TIM=0 SNMP_RET=0 SNMP_MON=public
SNMP_CON=private
16.26.160.23 BldRtr1.compaq.com BldRtr1
For the system BldRtr5, the TYPE and protocols used for discovery
were changed from the current defaults. Because the remaining
keyword entries are missing, the standard defaults
are applied for the SNMP timeouts, retries, and community strings.
#$IMXE: TYPE=Router
16.26.160.24 BldRtr5.compaq.com BldRtr5
For the system AcctServer, only the TYPE was changed from the
current defaults.
#$IMXE: TYPE=Server
16.26.176.36 AcctServer.compaq.com AcctServer #user comments
The global default for TYPE was changed from Unknown to Router.
All subsequent entries will be identified as routers until a TYPE
statement is used to specify another type or restore the default.
#$IMXE_DEFAULT: TYPE=Router
16.25.176.38 FloorRtr2a.compaq.com FloorRtr2a #user comments
The default for the next host entry was changed to management
processor, which is enclosed in quotes. #$IMXE:
TYPE="Management Processor" AcctSvriLo.compaq.com
16.25.176.37 AcctSvriLo #user comments
...
Default ValuesIf a parameter is missing in the hosts file, the default is applied.
Related Procedure
Related Topic
|