Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have this weird problem. I need to access a website that contains an underscore from Linux. The hostname is invalid and Linux does treat it as such.

The problem is that access from Windows seems to work just fine and therefore the admin won't fix it.

Is there any way to access such site?

EDIT: The hostname is:

host works

ping and browsers don't work, I have tried both un-encoded and encoded versions of the hostname

share|improve this question
Did you try to use the hex value instead (url encoded)? – lynxlynxlynx Jul 30 '12 at 13:04
Does hostname resolution work? Then you could at least access the website via IP if there isn't any virtual host depending on the actual host name. – scai Jul 30 '12 at 13:12
@scai host works, ping and browsers don't, and the problem it's one sub-hostname, so yeah virtual hosts are present. – Let_Me_Be Jul 30 '12 at 13:14

1 Answer 1

up vote 5 down vote accepted

Since you can find the IP with host, add an entry to your /etc/hosts file with a new name to the same IP.



$ ping -c 1
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=48 time=69.157 ms

--- ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 69.157/69.157/69.157/0.000 ms
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.