Can you use an underscore in a domain name? The short answer is no. The longer is maybe, but don't do it.
I'm working on a project, and I'm the first Windows user on the team. They set up there local dev domains to point to sites:
I set it up using a hosts file on my Windows unit. I was able to ping that domain without issues and was able to telnet to the port. But, the web browsers wouldn't load the URL. This was confusing.
I resolved all the site load issues by changing the URL from
To make things extra odd, I can't replicate this on my own personal machine. Sites with URLs seem to load perfectly, so I'm wondering if the issue is with Tomcat--not Apache Web Server--or Docker which I'm not using on my own machine.
There is a great write up on this here. The general gist is don't use the underscore in URLs host names, or Fully Qualfiied Domain Names, but they might be okay in other types of DNS lookups.