You get a bonus - 1 coin for daily activity. Now you have 1 coin

Cyrillic (Internationalized) domains and IDNA - how to configure them

Practice



The Domain Name System (DNS) originally supported domain names written only in Latin letters. This continued for a long time, and for a long time this suited everyone. But progress doesn't stand still, and an international domain name system was developed, allowing a site's name to be entered in the browser in one's native language.

Recently, Russia has also opened its own root domain .РФ, allowing sites with Russian names to be registered (мойсайт.рф). In this article I'll briefly explain how to configure a Bind/Named server to work with international domains.


First of all — how does it work?

The "Latin characters only" principle actually hasn't gone anywhere. Currently, DNS servers can only "resolve" names written in Latin characters, additionally using digits and special characters like the hyphen and underscore. When a user enters a Russian (or other international) site name in the browser's address bar, a browser with IDNA support converts the national characters into what's called Puny-code on its own and queries the DNS servers with the already-converted name.

Puny-code consists only of allowed Latin characters, digits, and signs, which were also allowed in the past for standard Latin DNS. Here are a few examples of Russian names corresponding to puny-codes:

мойдомен.рф = xn--d1acklchcc.xn--p1ai
другой-сайт.рф = xn----8sbhd0ac5aonmd.xn--p1ai
www.новый.рф = www.xn--b1aoke0e.xn--p1ai

Converting from Cyrillic to Puny-code doesn't have to be done by hand. Ready-made web services exist for this. As a rule, they're found at domain registrars and aren't hard to find through search engines. Here's an example of 3 of them:

http://www.reg.ru/whois/punycode
http://www.bname.ru/tools/webmasters/encoding_punycode/
http://tools.mydiv.net/punycode/

They were working at the time of writing this article and reliably produced a working puny-code from a Russian name.


Now let's configure our bind server to work with Puny-code.

Actually, there's not much you need to configure at all. Domain zones are created exactly the same way as with regular Latin domains. Below is an example of one zone from a regular DNS server.

Part of the file specifying domain zones (for example, /etc/bind/named.conf.zones):

...

# Сайт мойдомен.рф
zone "xn--d1acklchcc.xn--p1ai" {
type master;
file "/etc/bind/master/moi_sait.rf";
};

...

And here's a sample file describing this domain (in this case: /etc/bind/master/moi_sait.rf):

$ORIGIN .
$TTL 3600 ; 1 hour
xn--d1acklchcc.xn--p1ai. IN SOA ns1.mydomain.ru. root.mydomain.ru. (
2011011801 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS ns1.mydomain.ru.
NS ns2.mydomain.ru.
A 255.255.255.255

$ORIGIN xn--d1acklchcc.xn--p1ai.
www CNAME xn--d1acklchcc.xn--p1ai.

As you can see, there's nothing complicated.


So how do you set this up in the web server?

Just as simply as in the DNS server. Name the virtual server by the Puny-code, and the link to the directory with the files for the web server however is convenient for you. Again, a simple example based on Apache2 for the same site "мойдомен.рф".

# Мой домен
<VirtualHost *:80>
ServerName xn--d1acklchcc.xn--p1ai
ServerAlias www.xn--d1acklchcc.xn--p1ai
DocumentRoot /www/moisait.rf
DirectoryIndex index.php
</VirtualHost>

Of course, this variant is just an example — but it will work like this already.

Additional information can easily be found on the internet.
created: 2017-05-09
updated: 2026-03-10
422



Was this answer useful?
Choose a quick rating so we can improve the next answer for you.
How satisfied are you?


Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)