Name

ip host — global

Synopsis

ip host name [tcp-port] address [address]
no ip host name address

Configures

A static hostname that maps to one or more IP addresses

Default

None

Description

This command allows you to define an IP address for a hostname. Each hostname can have up to eight IP addresses associated with it. This is similar to a host file on a workstation (for example, the /etc/hosts file on Unix).

name

The name of a host.

tcp-port

Optional. The port to connect to on the host when using the telnet command.

address

The address assigned to the host.

Example

The following commands define two IP hosts; the second one has two IP addresses:

ip host gateway1 10.10.1.1
ip host gateway2 10.10.1.2 10.10.1.3

Get Cisco IOS in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.