Directly manipulates address-mapping entries in the system configuration database.
To Add an Address-to-Host Name Mapping
hostent -a IPAddress -h "HostName..."
To Delete an Address-to-Host Name Mapping
hostent -d IPAddress
To Delete All Address-to-Host Name Mappings
hostent -X
To Change an Address-to-Host Name Mapping
hostent -c IPAddress -h "HostName..." [ -i NewIPAddress ]
To Show an Address or Host Name in Colon Format
hostent -s { IPAddress | "HostName" } [ -Z ]
To Show all Address-to-Host Name Mappings in Colon Format
The hostent low-level command adds, deletes, or changes address-mapping entries in the system configuration database. Entries in the database are used to map an Internet Protocol (IP) address (local or remote) to its equivalent host names.
You can use the System application in Web-based System Manager (wsm) to change system characteristics. You can also use the System Management Interface Tool (SMIT) smit hostent fast path to run this command.
Item | Description |
---|---|
-a IPAddress | Adds an IP address-to-host name mapping entry for the Internet Protocol address in the database. Specify the host names with the -h flag. |
-c IPAddress | Changes an IP address-to-host name mapping entry in the database that corresponds to the address that is specified by the IPAddress variable. Specify the changed host names with the -h flag. If you want to change the current IP address to a new address (IPAddress), use the -i flag. |
-d IPAddress | Deletes the IP address-to-host name mapping entry in the database that corresponds to the address that is specified by the IPAddress variable. |
-h"HostName..." | Specifies a list of host names. Entries in the list are to be separated by blanks. The -h"HostName..." flag should be used with the -a flag. The -c flag might also require the -h"HostName..." flag. |
-i NewIPAddress | Specifies a new IP address. This flag is required by the -c flag if an existing IP address is to be replaced by the NewIPAddress variable. |
-S | Shows all entries in the database. |
-s"HostName" | Shows an IP address-to-host name mapping entry matching the host name specified by the "HostName" variable. |
-s IPAddress | Shows an IP address-to-host name mapping entry matching the entry specified by the IPAddress variable. |
-X | Deletes all IP address-to-host name mapping entries in the database. |
-Z | Generates the report of the query in colon format. This flag is used when the hostent command is started from the SMIT usability interface. |
hostent -s alpha
In example 2, the entry to be shown matches the host name alpha.Item | Description |
---|---|
/etc/hosts | Contains host names and addresses for the network. |