How to add non latin entry in the Windows Host file ? (%SystemRoot%\System32\drivers\etc\hosts)

There is a small tip if you need to add a non latin entry in the host file.

An example;

127.0.0.1         www我等主营.com

or

127.0.0.1   локалхост

The file itself does not accept any non latin encoding, thus those two example over would not work, but you can bypass the problem with punycode. (Look there for a generator)

A description from Wikipedia of what is punycode;

Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System. For example, “München” (German name for the city of Munich) would be encoded as “Mnchen-3ya”.

 

That tip would transform our two test domain to that;

127.0.0.1 xn--80atccmdviy

or

127.0.0.1    xn--tiq769bnnsi9h.com

 

Thanks

 

ps. Some post referencing that problem in Serverfault : 1, 2

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s