cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1287
Views
5
Helpful
5
Replies

Cisco 2951: %IP: Bad hostname format when using a domain name

roncro
Level 3
Level 3

Hello,

 

I own a domain name, let's call it mydomain.us, and I have a few hosts that are multihomed and have a public IP as well as a private IP, and I am trying to see if I can do the following on a Cisco 2951 router.

 

If I want to use the same hostname/domain name, in the local/private network, and try to enter something like:

Charon-2951(config)#ip host thathost@mydomain.us 192.168.1.113  

 

edit:   oops..  I meant thathost.mydomain.us...

 

I get:

%IP: Bad hostname format

 

Is that because the "domain-name localdomain" setting on the router?

(the question actually is, can I get around that?)

 

thanks,

 

Ron

 

 

1 Accepted Solution

Accepted Solutions

balaji.bandi
Hall of Fame
Hall of Fame

how about configuring like below example :

 

ip domain name mydomain.us

ip host thathost 192.168.1.113

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

View solution in original post

5 Replies 5

Richard Burts
Hall of Fame
Hall of Fame

Ron

 

I am not authoritative on this (and if someone who is authoritative would jump in that would be good) but I believe that the issue is that the ip host command expects a simple host name (not associated with a domain name). I do not believe that there is a way around this. 

HTH

Rick

Hi Rick,

 

when I revisited the config,  I think I made a typo, that's posibly why I saw the error.

 

Also,  pretty much all hostnames, for lookups, I have in there are like:

ip host thathost.localdomain 192.168.x.y

 

It seems the router does accept config lines like:

ip host thathost.mydomain.us 192.168.a.b    while ... if I didn't it would resolve to  thathost.mydomain.us   p.q.r.s, a public address,   which I wanted to prevent.

 

So what happens is, I think,  that if you tell the router it is 'located' in localdomain, it being   it's domain-name is localdomain,  it treats that as the default domain search.   so if I would like to 'go to'  thathost, my router's domain-name being used as the default search domain, it  assumes I am looking for  thathost.localdomain.  (I think if domain-name was set to   'mydomain.us' it would  assume the hostname i was looking for would be thathost.mydomain.us.)

 

some of it (above) is what I see, and it looks like that is how it works?

 

Ron

Ron

 

I am not clear about your follow up question and am not able to give you an answer for it. Perhaps someone else in the community can help with this.

HTH

Rick

balaji.bandi
Hall of Fame
Hall of Fame

how about configuring like below example :

 

ip domain name mydomain.us

ip host thathost 192.168.1.113

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

that is what I started doing,  somehow I was thinking to use two domain names, but that didn't make much sense.

 

thanks,

 

Ron

Review Cisco Networking products for a $25 gift card