cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Join Customer Connection to register!
309
Views
5
Helpful
5
Replies
roncro
Participant

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

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
VIP Expert

how about configuring like below example :

 

ip domain name mydomain.us

ip host thathost 192.168.1.113



BB


*** Rate All Helpful Responses ***

View solution in original post

5 REPLIES 5
Richard Burts
Hall of Fame Guru

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
VIP Expert

how about configuring like below example :

 

ip domain name mydomain.us

ip host thathost 192.168.1.113



BB


*** Rate All Helpful Responses ***

View solution in original post

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

 

thanks,

 

Ron