Live data from Hacker News

Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

twitter.com

101–110 of 118 posts

Re: Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

#101

Earlier quoted context omitted.

Punycode is the joke

Limiting dns names to 26 latin characters and the 10 arabic digits is the joke. From the top of my head I can't come up with a single language other than English that doesn't use additional letters (or at least additional modifiers on some letters). Punycode is the most sane solution to an insane situation.

Even english has some borrowed expressions like "à la" that can are more correctly written with non-ascii characters, so not even english is really safe, if you want to be a bit fancy about it.

Re: Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

#102

Earlier quoted context omitted.

Punycode is the joke

Limiting dns names to 26 latin characters and the 10 arabic digits is the joke. From the top of my head I can't come up with a single language other than English that doesn't use additional letters (or at least additional modifiers on some letters). Punycode is the most sane solution to an insane situation.

DNS should have been UTF-8 from the beginning; that would have been a good solution. As things stand, slapping punycode on it is a terrible solution to a dumb problem.

But then again, when you invent something, you decide how it works, and the world could just re-invent a more international version of DNS but chose not to.

Also, ASCII is still probably the best charset to use, if you have to choose one; it can represent most possible sounds in some way and symbols represent single sounds (as opposed to, for example, chinese characters). It's very widely used (as opposed to, for example, the greek alphabet).

So yes, limiting DNS names to 26 latin characters and 10 arabic digits was probably the best option at the time.

Re: Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

#103
I wanted to make a new website using emojis instead of "www" as a joke about the number of syllables. ("Angry Face Angry Face Angry Face" takes the same amount of time to say "www".)

Browsers kept insisting on showing this as xn--b38haa.crankybill.com, so I went with "grr" instead.

Re: Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

#104

Earlier quoted context omitted.

Limiting dns names to 26 latin characters and the 10 arabic digits is the joke. From the top of my head I can't come up with a single language other than English that doesn't use additional letters (or at least additional modifiers on some letters). Punycode is the most sane solution to an insane situation.

Swahili, Hawaiian, Italian, that's just off the top of my head, there are many others. Hawaiian uses ' as a proper letter, granted.

Doesn't Italian use accented vowels in some cases?

Re: Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

#105

Earlier quoted context omitted.

I have, but I live in Norway, where we have æøå in the standard alphabet. I suspect it’s more common still in Asian countries, because at least in Norwegian, there are standard ascii replacements for all the extra letters, å = aa, ø = oe, æ = ae

Here in Sweden I have never encountered a single legit IDN domain.

I know http://www.xn--sknetrafiken-ucb.se, but like many it just redirects to an ASCII version. (Does it look weird seeing "Skane" when you know it ought to be "Skaane"?)

Similarly for a power company, http://xn--rsted-uua.dk, just a redirect, but they do use it on adverts and my electricity bill.

Some that don't redirect: http://xn--mgk--jra.dk/ https://www.xn---strm-uuae.dk/ https://xn--magnusbrth-85a.se/

(HN has converted the displayed URLs to Punycode, presumably as a quick security measure without reference to the reasonable characters for each TLD.)

Re: Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

#106

Earlier quoted context omitted.

Swahili, Hawaiian, Italian, that's just off the top of my head, there are many others. Hawaiian uses ' as a proper letter, granted.

Doesn't Italian use accented vowels in some cases?

Ah, yes of course it does. Silly me.

None of this detracts from the greater point, being that we need a way for all writing systems to somehow squeeze down into the subset of ASCII supported by legacy protocols.

Re: Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

#107
post #61

Earlier quoted context omitted.

But... What about legit unicode domains? I own a couple that I use for personal projects or file sharing.

I've yet to see a legit unicode domain, and my country doesn't speak English as a first language. To tell you the truth IDN domains feel like a failure, a gimmick. Their biggest market probably was meant to be countries that don't use the Latin alphabet, and they've failed spectacularly. If you use Firefox, for your own security, set network.IDN_show_punycode to true.

There are a few in Roman-lettered Europe, but they're not exactly common. Many are redirects to an ASCII domain.

They seem to be used in Russia a little more, especially with the .рф TLD[1], although many are still just redirects.

I have no idea what the text means, but these sites look reasonable: https://www.xn--80aicstx0byb.xn--p1ai/ http://xn--j1abth1c.xn--p1ai/ https://xn--d1ai6ai.xn--p1ai/

[1] https://en.wikipedia.org/wiki/.%D1%80%D1%84

(HN seems to have translated these to Punycode, presumably a quick security measure without respect for non-ASCII languages.)

Re: Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

#108
post #46

Earlier quoted context omitted.

Two ideas to lessen the trade-off: 1. Use a browser extension that throws a warning on all unicode domains (maybe even with unicode highlighting). Drawback: Needs to be done per-device. 2. Let your pihole MitM all https traffic with a certificate you do NOT trust (maybe create one per domain, so you can add it to the trusted list); if the connection is over http, upgrade it to https (if the server doesn't speak https…

Modification of 2nd idea. Run two dnsmasq servers: one which would do resolving and listening on loopback interface, and other listening 53/udp with no-resolv, whitelist of IDNs and filtering rules to pass normal and block other punycode DNs.

I came up with another "solution" using the linux kernel NFQUEUE: https://news.ycombinator.com/item?id=22003933

Re: Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

#109

Earlier quoted context omitted.

if you run pihole or a local dnsmasq/unbound it should be possible to mitigate it by sinkholing any unicode domains, e.g. with dnsmasq (requires a patch https://github.com/spacedingo/dnsmasq-regexp_2.76 ) you can do this: address=/:xn--*:/0.0.0.0 does anyone know if something like this is possible with unbound?

As far as I know, no, it’s not possible to do in Unbound since it doesn’t support regex or wildcards on part of a domain (except whole parts as in DNS itself e.g. *.foo.example).

I came up with another solution to work separate from unbound/dnsmasq using the NFQUEUE in the linux kernel. I basically am processing the dns packets in user-land :) ... bit of a hack but it made for a great afternoon https://news.ycombinator.com/item?id=22003933

Re: Add '127.0.0.1 xn–9q8h' to /etc/hosts gives you "localghost"

#110
post #61

Earlier quoted context omitted.

I've yet to see a legit unicode domain, and my country doesn't speak English as a first language. To tell you the truth IDN domains feel like a failure, a gimmick. Their biggest market probably was meant to be countries that don't use the Latin alphabet, and they've failed spectacularly. If you use Firefox, for your own security, set network.IDN_show_punycode to true.

There are a few in Roman-lettered Europe, but they're not exactly common. Many are redirects to an ASCII domain. They seem to be used in Russia a little more, especially with the .рф TLD[1], although many are still just redirects. I have no idea what the text means, but these sites look reasonable: https://www.xn--80aicstx0byb.xn--p1ai/ http://xn--j1abth1c.xn--p1ai/ https://xn--d1ai6ai.xn--p1ai/ [1] https://en.wikipe…

it used to be possible to block this with a patched dnsmasq that allows setting a regex, but the fork is not maintained and merging the patches to upstream is also not much fun.

so I hacked something together that uses the linux kernel NFQUEUE: https://github.com/DyslexicAtheist/nfq

this way I have guarantee that these domains will never be resolved (which is what I want :))

Post reply on HN