Share this question

Welcome to Teachnovice Q&A, where you can ask questions and receive answers from other members of the community.

This is a collaboratively edited question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is the hostname case sensitive?

0 like 0 dislike

Is the hostname case sensitive? Is


equal to

ping myhost

Does it depend on the DNS used? Are there differences between Win/Mac/Unix systems?

asked Dec 23, 2014 by michelemarcon  

3 Answers

0 like 0 dislike
Best answer
Names resolved from DNS are case insensitive. This is important to prevent confusion. If it was case sensitive then we would have eight variants of .com (.com, .Com, .cOm, .COm, .coM, .CoM, .cOM, and .COM). Country codes would have four.

If name resolution is case-sensitive for Ping it is not being done by DNS.
answered Dec 23, 2014 by BillThor  
It does apparently get somewhat tricky after Internationalized Domain Names where added. In non-ASCII contexts case may matter.
@Zoredache: It appears the internationalized domains using the IDNA system must be encodable in Punycode, which involves translation to lowercase. There are also additional restrictions to ensure the names are visually distinct. Also you don't want to force users to ensure they get the case right.
0 like 0 dislike
As BillThor mentioned, it's not case sensitive at the DNS or netbios resolution level.

The various OSes won't have a problem with the different casing either.

However, the applications may be aware of them. For example, the web platforms on the various environments can check for case sensitivity. It's more common now for search engine optimization (SEO) reasons to watch for different casing and redirect. That's all up to the application though so the answer there is that it varies.

For the 'most part' the hostname isn't a case sensitive concern at the application level either though.
answered Dec 23, 2014 by Scott Forsyth - MVP  
0 like 0 dislike
I just finished troubleshooting an issue on an embedded SE Linux device where host name resolution was exhibiting case sensitivity.

"ping MYHOST" would ping to, whereas "ping myhost" would ping the correct IP Address.

nslookup produced correct results for both uppercase and lowercase, indicating that the DNS server was not at fault.

But unlike nslookup, which ignores the cache, "getent hosts MYHOST" output "", and "getent hosts myhost" output the correct IP Address.

So nscd is apparently case sensitive. Calling "nscd -i hosts" to clear the cache fixed the issue.

The MYHOST in (uppercase) ended up cached with due to a process trying to establish a connection to MYHOST before the DNS entry was created, which happens when the remote device gets its DHCP assignment.
answered Dec 23, 2014 by Andrew Weimholt