IP HOST cdc ip.addr

Answered Question

I just took over the management of a new switch and I saw this in the config.

IP HOST cdc 10.51.x.x

Anybody know what purpose this serves?

I saw this in cisco help but I still do not know what the use of this IP HOST is.

ip host

To define a static host name-to-address mapping in the host cache, use the ip host global configuration command. To remove the name-to-address mapping, use the no form of this command.


ip host name [tcp-port-number] address1 [address2...address8]

no ip host name address


Syntax Description

name

Name of the host. The first character can be either a letter or a number. If you use a number, the operations you can perform are limited.

tcp-port-number

(Optional) TCP port number to connect to when using the defined host name in conjunction with an EXEC connect or Telnet command. The default is Telnet (port 23).

address1

Associated IP address.

address2...address8

(Optional) Additional associated IP address. You can bind up to eight addresses to a host name.


Correct Answer by Jon Marshall about 7 years 5 months ago

John


"it has always worked on the device where it is configed. I was hoping it would work from another device."


Ahhh, i see :-)


Well you can get it work from another device but you need to configure the router/switch that has the ip host entry as a DNS server. So


R1

==


ip host oh3 192.168.10.1


int s0/0

ip address 192.168.5.1 255.255.255.252


ip dns server


R2

==


ip name-server 192.168.5.1


int s0/0

ip address 192.168.5.2 255.255.255.252


then from R2 you should be able to ping oh3.


So the ip host is used for local resolution on the router and also it can be used to resolve remote DNS queries but you must then configure the router as a DNS server.


Jon

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Jon Marshall Wed, 10/21/2009 - 10:57
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

John


From the router you could now


telnet cdc

ping cdc


and the router would substitute the name cdc with the IP address 10.51.x.x


Jon

Jon Marshall Thu, 10/22/2009 - 05:46
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Just tested on a router and it worked fine for me. When you say you get no response what happens if you simply ping the IP address ?


Jon

Does this only work on a router?

I found this on L2 switch.

I have since tried to duplicate it on my switch that I have on my desk; a cisco 3560g.

ip host jw 10.49.1.102

RT03 is our main router but the IP host jw is coded on the switch at my desk.


KBCOH1RT03#ping jw

Translating "jw"...domain server (255.255.255.255)

% Unrecognized host or address, or protocol not running.


Jon Marshall Thu, 10/22/2009 - 06:31
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

John


An interface must be up and running with an IP address on it for this to work.


Edit - actually it looks like an interface just needs to be configured with an IP for it to work.


Jon

I tried it on the original switch where I found it but it does not work.

That IP address is assigned to a svi.


So I coded one on our backup router and that does not work either.

The interface to the LAN for our backup router is 192.168.1.254

So I coded ip host oh3 192.168.1.254 Don't know if this makes a difference but that address is the real address of an HSRP configed interface.

Jon Marshall Thu, 10/22/2009 - 07:09
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Can you post output of "sh hosts" from your backup router ?


Jon

KBCOH1RT04#sh hosts

Default domain is not set

Name/address lookup uses domain service

Name servers are 10.49.2.252, 10.49.2.253


Codes: UN - unknown, EX - expired, OK - OK, ?? - revalidate

temp - temporary, perm - permanent

NA - Not Applicable None - Not defined


Host Port Flags Age Type Address(es)

oh3 None (perm, OK) 0 IP 10.49.1.189


Jon Marshall Thu, 10/22/2009 - 07:25
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Okay, you have the same output as i do except mine works and yours doesn't.


Which IOS version are you using ?


Can you post full config of router ?


Jon

Jon Marshall Thu, 10/22/2009 - 07:42
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

John


I'm using 12.4 mainline but that should not make a difference.


I literally can fire up a router, configure an IP address on an interface (don't even need to bring it up), add an "ip host ..." entry and then when i type "ping " it resolves it and tries to ping it.


So unless there is something in your config that is stopping this i'm not sure what is happening.


Jon

Jon Marshall Thu, 10/22/2009 - 07:50
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Can you run the same command on KBCOH1RT04 ?


Jon

Correct Answer
Jon Marshall Thu, 10/22/2009 - 08:03
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

John


"it has always worked on the device where it is configed. I was hoping it would work from another device."


Ahhh, i see :-)


Well you can get it work from another device but you need to configure the router/switch that has the ip host entry as a DNS server. So


R1

==


ip host oh3 192.168.10.1


int s0/0

ip address 192.168.5.1 255.255.255.252


ip dns server


R2

==


ip name-server 192.168.5.1


int s0/0

ip address 192.168.5.2 255.255.255.252


then from R2 you should be able to ping oh3.


So the ip host is used for local resolution on the router and also it can be used to resolve remote DNS queries but you must then configure the router as a DNS server.


Jon

Actions

This Discussion