Question about hostname format on 3750G switch running IOS 12.2(40)SE

Unanswered Question
Sep 13th, 2007
User Badges:

In previous versions of IOS, we were able to configure the hostname as an ip address, i.e "hostname". With IOS 12.2(40)SE the hostname command will not accept an IP address as the name. Does anyone know is this is intentional or a bug? Documentation seems to imply that an IP address for the hostname is valid.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
szahid Thu, 09/13/2007 - 15:16
User Badges:
  • Silver, 250 points or more

We started putting warning when you try to use ip address as a hostname .

% Hostname contains one or more illegal characters.

this o/ps is from 12.2(35)SE . From the above syslog , I would say its intentional what you are seeing in 12.2(40)SE.



glen.grant Thu, 09/13/2007 - 15:43
User Badges:
  • Purple, 4500 points or more

I would think that would flunk almost any audit if you are using a ip address as your hostname , not a good practice.

ankbhasi Thu, 09/13/2007 - 22:36
User Badges:
  • Cisco Employee,

Hi Cberns,

Which release allows you to configure the hostname as ip address? Can you please confirm the same? What you are observing in Rel.12.2(40) is an expected behavior and also as per the documentation guide "They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphens"



CHRISTINE BERNS Fri, 09/14/2007 - 05:25
User Badges:

Release 12.2(25) allows you to configure the host name as an IP address. The doc at the link you provide for for 12.2(40) also contains this:

"If you use the switch IP address as its hostname, the IP address is used and no DNS query occurs. If you configure a hostname that contains no periods (.), a period followed by the default domain name is appended to the hostname before the DNS query is made to map the name to an IP address. The default domain name is the value set by the ip domain-name global configuration command. If there is a period (.) in the hostname, the Cisco IOS software looks up the IP address without appending any default domain name to the hostname."

This does imply to me that one should be able to enter the hostname in the format


This Discussion