cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1045
Views
0
Helpful
15
Replies

IP HOST cdc ip.addr

john.wright
Level 3
Level 3

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.

1 Accepted Solution

Accepted Solutions

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

View solution in original post

15 Replies 15

Jon Marshall
Hall of Fame
Hall of Fame

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

There must be something else that is needed to make it work because I get no response to a ping to cdc.

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.

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.

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

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

I cannot post the config but here is the ver.

C2800NM-IPBASE-M), Version 12.4(15)T9

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

Here is what I get

KBCOH1RT03#ping oh3

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

% Unrecognized host or address, or protocol not running.

Can you run the same command on KBCOH1RT04 ?

Jon

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco