### set host

Use the set host command to

- Configure the host table, which contains host name-to-IP address mappings
- Display entries in the host table
- Delete entries from the host table

Root privileges are required to issue the set host command.

If you configure a host table and a DNS server, the device/terminal server will attempt to satisfy a request by first searching the host table and then the DNS server.

See the set config command for information on configuring the device/terminal server to use a DNS server.

#### About the Host Table and DNS

The device/terminal server’s IP component can use the host table and a DNS server to map host names to IP addresses. These mappings allow users to identify hosts by user-friendly names, instead of IP addresses.

This is a convenience only. If you do not configure the host table or configure DNS, users will have to identify hosts by IP addresses.

If the device/terminal servercan access a DNS server, there is no reason to configure the host table.

You can configure

- A host table and DNS
- Either the host table or DNS
- Neither the host table nor DNS

#### Command Syntax

##### Configuration Syntax

Enter the set host command as shown below to add (configure) entries in the host table.

`set host name=host_name ip=ip_addr`

##### Display Syntax

Enter the set host command as shown below to display host table entries.

`set host [range=range]`

##### Delete Syntax

Enter the set host command as shown below to delete entries from the host table.

`set host rmhost=on {range=range|rmhost=host_name}`

#### Command Fields

Command Field | Description
ip | Specifies the IP address that is to be mapped to the name specified on the name field.
name | Specifies the name that is to be mapped to the IP address specified on the ip field.
range | Specifies one or a range of index numbers that identify entries in the host table.
rmhost | on - specifies that the host table entry identified by a host name on the name field be removed from the table. host_name - specifies that the host table entry identified by this host name be removed from the table.

#### Command Examples

##### Displaying the Host Table

In this example, the set host command displays the entire host table.

`set host`

##### Displaying an Entry in the Host Table

In this example, the set host command displays an entry in the host table.

`set host range=4`

##### Configuring a Name-to-IP Address Mapping

In this example, the set host command configures a mapping between a host name and an IP address.

`set host ip=190.150.150.10 name=server1`