I can't connect with addresses containing domains with dash followed by dot, for example:


The only solution I found for this is adding domains like those to /etc/hosts, but I don't know all of those, so I can't do it.

I know this is out of standard, but Windows allows addressing like this and I have to implement it also under Linux.

System info: Fedora 20, linux 3.12.5-302 Tested under Firefox, Opera

I tested real-life, public internet domain and dig is working proper but ping is not.

  • You need to provide more info, such as what you're using to test. Is this a browser, some utility, what? That exact host name works perfectly fine on my system: i.imgur.com/FucBp8a.png – Patrick Oct 23 '14 at 11:37
  • Thansks for reply. I've added needed info. – Nightcat Oct 23 '14 at 13:52
  • 1
    Since RFC 952 does not allow hostnames to end with an hyphen (and neither does RFC 1123), I'd say this is standard-related. In your case, the example- subdomain could be considered invalid. – John WH Smith Oct 23 '14 at 15:22

I believe you out of luck with that, because linux libc doesn't support this. Your only options is to change glibc or rebuild your software against some alternative C library.


You could also override gethostbyname with some ld-preloaded library of your own and provide your own resolution method there. This was you'll have no need to build anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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