International Domain Names in IIS(Kristofer Gafvert, August 2, 2007)
DNS (when writing this) has no support for non-ASCII characters. Many people do however want to use international domain names using non-ASCII characters (for example Swedish characters åäö). To overcome this problem and support non-ASCII characters, RFC 3490 "Internationalizing Domain Names in Applications (IDNA)" was developed. In short, this means that support for non-ASCII characters are added by encoding the non-ASCII domain name to a domain name consisting of only ASCII characters. This encoding is explained in RFC 3492 "Punycode: A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)".
How the encoding is working
In order to understand the problem and the solution, we first need to understand the basic steps of what is happening from when the user types an international domain name to when the page is served by the web server. This is explained by the following steps (only relevant steps are shown):
- User types an international domain name into the browser, for example: www.räksmörgås.se.
- The browser encodes the domain name using punycode into an ACE (ASCII Compatible Encoding) string. In this case it is www.xn--rksmrgs-5wao1o.se
- The browser/client machine asks the DNS server what the IP address is for the domain name www.xn--rksmrgs-5wao1o.se (notice that it uses the punycoded string, not the original string with "strange" characters).
- The client makes a connection to the web server at the IP address returned by the DNS server in step 3.
- The client sends a request to the web server, using the host header www.räksmörgås.se.
- The web server sends a response (the page) to the client.
The key to understand what needs to be done to support websites using international domain names is shown in step 3 and step 5.
Two problems (DNS and IIS), two solutions
As we can see in the previous section, we have two things we need to configure: DNS and IIS (if you are using host headers to distinguish between websites, if you do not, there is no configuration to be made in IIS).
In DNS you need to add the proper record (usually an A record) with the domain name punycoded. In our example, this means that you must add www.xn--rksmrgs-5wao1o.se and not www.räksmörgås.se.
In IIS, if you are using host headers to distinguish between websites, you must add the host header with non-ascii characters (this is new in IIS 7, in IIS 6 you needed to add the punycoded name).
Should I really use the punycoded domain name as Host header?
In theory, the browser can send either the punycoded domain name, or a non-punycoded domain name in the Host header. According to RFC 2616 HTTP 1.1, the host header "MAY contain characters from character sets other than ISO-8859-1", but only when encoded according to the rules of RFC 2047.
IE 7 and Firefox 1.5+ punycodes the Host header field, while IE 8 sends a host header that includes non-ASCII characters.
Applies to [?]
IIS 7.0, IIS 7.5