Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
New Member

ip host command


What happens when the command ''ip host x.x.x.x x.x.x.x is used on a router?  Is the second address used if the first is not accessible?  I have two router, router A and router B.   Router B has two loopback address configured and there is a static router on router A to reach those address.  Router A has been configured with using the ip host command refering to the two loopbacks on router B.  When pinging the first loopback using an alias, the pings work, but when that loopback is shutdown, router A does not fall back to the second address to reach loopback2 on router B.  Am I missing something here?




ip host routerb x.x.x.x x.x.x.x




interface loopback1 ip address x.x.x.x

interface loopback2 ip address x.x.x.x


Make/Model:ISR Gen2 2921IOS: 15.2.4.S3

New Member

 I found this doing a quick


I found this doing a quick search. Hope it helps.

New Member

 Now, for convenience sake


Now, for convenience sake only, we can create an entry on R1 (using the "IP HOST" command, that says "If I refer to the host name of R3, I really mean the IP address of R3 at"  Again, this is just a convenience, and not required.   Lets demonstrate a ping to R3 before the IP HOST command, and then after.

R1(config)#do ping r3


Translating "r3"
% Unrecognized host or address, or protocol not running.


R1(config)#ip host r3
R1(config)#do ping r3


Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/80/112 ms


So as a review, the command "IP Route" is to add static routes and the command "IP HOST" is to match a name with an IP (like a mini DNS system, or hosts file on a computer).

Hall of Fame Super Gold

The original poster gives us

The original poster gives us a few details about the issue he wants to understand but not enough detail for us to be sure about the issue. He describes router B which has two loopback interfaces configured and router A which apparently has routes to both loopbacks on router B. He suggests that there is an ip host command for router B which has the addresses of both loopback interfaces. And he asserts that only the first address is used when he attempts to ping using the name of host B.


I have tested the ip host command with multiple addresses specified. I know for some commands that it works by trying the first address and if that is not successful then trying the next address. I do not remember testing the ip host command using ping. And I can believe that ping might try only the first address. But I would like the original poster to try the telnet command using the name specified in the ip host command (or try using the ssh command). I am confident that these commands will try the first address and if it is not successful then will try the remaining addresses.





CreatePlease to create content