09-13-2007 02:03 PM - edited 03-05-2019 06:28 PM
In previous versions of IOS, we were able to configure the hostname as an ip address, i.e "hostname 10.1.1.1". 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.
09-13-2007 03:16 PM
We started putting warning when you try to use ip address as a hostname .
1.1.1.1(config)#hostname 10.10.10.10
% 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.
Thanks
Salman.
09-13-2007 03:43 PM
I would think that would flunk almost any audit if you are using a ip address as your hostname , not a good practice.
09-13-2007 10:36 PM
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"
http://www.cisco.com/univercd/cc/td/doc/product/lan/cat3750/12240se/scg1/swadmin.htm#wp1051875
Regards,
Ankur
09-14-2007 05:25 AM
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 10.1.1.1.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide