ip host

To define static hostname-to-address mappings in the Domain Name System (DNS) hostname cache, use the ip host command. To remove a hostname-to-address mapping, use the no form of this command.

ip host name address1 [ address2 ... address6 ]

no ip host name address1 [ address2 ... address6 ]

Syntax Description

name
Hostname. The name can be any case-sensitive, alphanumeric string up to 80 characters.
address1
IPv4 address in the x.x.x.x format.
address2 ...address6
(Optional) Up to five additional IPv4 addresses in the x.x.x.x format.

Command Default

None

Command Modes

Global configuration mode

Command History

Release
Modification
5.0(3)N1(1)
This command was introduced.

Usage Guidelines

Use the ip host command to add a static hostname to DNS.

Examples

This example shows how to configure a static hostname:

switch(config)# ip host mycompany.com 192.0.2.1
 

Related Commands

Command
Description
show hosts
Displays information about the IP domain name configuration.