mDNkit Configuration File
- Overview
- Entries That Can Be Specified in the Configuration File
- Local Encoding
- Map File Format
- Set File Format
Overview
The client configuration file describes various settings for multilingual domain name processing. This file is loaded by the client for which the mDNkit is used to make it multilingual (internationalized). The resconf module of the MDN library is used to load this file and the following entries related to multilingual domains can be set.
- Encoding of domain name for DNS protocol
- Normalization form based on NAMEPREP
- Alias for encoding name
- Normalization form unique to a specific language or top level domain
This file is a plain text file and each line of the file (except comment lines starting with # and blank lines) consists of the following simple format.
Keyword value ...
The configuration file is placed as follows when mDNkit is compiled with the default settings.
/usr/local/etc/mdn.conf
The setting content is discussed below for each keyword.
Entries That Can be Specified using the Configuration File
idn-encoding
Specifies the encoding for multilingual domain names used by the resolver and DNS server.
[Syntax]
idn-encoding
<encoding>
The following names can be specified as <encoding>.
Punycode
AMC-ACE-Z
(it is the old name of Punycode)RACE
DUDE
- Encoding name recognized by
iconv_open()
of your system.- Alias name of the above encoding defined in the alias definition file (refer to
encoding-alias-file
).
[Setting example]
idn-encoding Punycode
There is no client-encoding entry because the local encoding at the application side is determined by the locale. Local encoding is explained in later section.
nameprep
NAMEPREP prescribes the normalization scheme for multilingual domain names. This entry is used to specify which version of NAMEPREP is used.
[Syntax]
nameprep
<version>
The following can be specified in <version>.
nameprep-03
- Normalization scheme corresponding to Internet draft draft-ietf-idn-nameprep-03.txt.
nameprep-05
- Normalization scheme corresponding to Internet draft draft-ietf-idn-nameprep-05.txt.
nameprep-06
- Normalization scheme corresponding to Internet draft draft-ietf-idn-nameprep-06.txt.
nameprep-07
- Normalization scheme corresponding to Internet draft draft-ietf-idn-nameprep-07.txt.
[Setting example]
nameprep nameprep-07
The NAMEPREP processing procedure consists of the following three steps.
- Mapping
- Normalization
- Prohibited check, unassigned check
In addition to the nameprep
entry, entries used to specify the version for each process are also provided.
nameprep-map
<version>nameprep-normalize
<version>nameprep-prohibit
<version>nameprep-unassigned
<version>
When the above four entries are combined, the same operation takes place as when the following is specified.
nameprep
<version>
When both nameprep
and other detailed entries are specified, the detailed entry takes precedence.
nameprep-map
This entry is used to specify the mapping method in NAMEPREP.
[Syntax]
nameprep-map
<scheme> ...
Use <scheme> to specify the mapping method. When more than one method is specified, they apply in that order (from left to right). The following can be specified in <scheme>.
- <version>
- Mapping following the special version of NAMEPREP. For available version numbers, refer to
nameprep
.filemap:
<pathname>- The mapping definition is loaded from <pathname> file. For information on how to include descriptions in the file, refer to Map File Format.
[Setting example]
nameprep-map nameprep-07
nameprep-normalize
This entry is used to specify the normalization scheme in NAMEPREP.
[Syntax]
nameprep-normalize
<scheme> ...
Use <scheme> to specify the normalization scheme name. When more than one scheme is specified, they apply in order (from left to right). The following can be specified in <scheme>.
- <version>
- Normalization following the specific version of NAMEPREP. For available version numbers, refer to
nameprep
.unicode-form-kc
- Unicode normalization form KC by the latest version in Unicode version mDNkit supports.
unicode-form-kc/3.0.1
- Unicode normalization form KC by Unicode version 3.0.1.
unicode-form-kc/3.1.0
- Unicode normalization form KC by Unicode version 3.1.0.
[Setting example]
nameprep-normalize unicode-form-kc
nameprep-prohibit
This entry is used to specify the method of checking for prohibited characters in NAMEPREP.
[Syntax]
nameprep-prohibit
<set> ...
Use <set> to specify the name of the prohibited character set. When more than one character set is specified, they apply in order (from left to right). The following can be specified in <set>.
- <version>
- Prohibited character sets described in the specific version of NAMEPREP. For available version numbers, refer to
nameprep
.fileset:
<pathname>- The definition of prohibited characters is loaded from the <pathname>file. For information on how to include descriptions in the file, refer to Set File Format.
[Setting example]
nameprep-prohibit nameprep-07
nameprep-unassigned
This entry is used to specify the method of checking for unassigned code points (code points for which characters are not assigned) in NAMEPREP. When more than one method is specified, they apply in order (from left to right).
[Syntax]
nameprep-unassigned
<set> ...
Use <set> to specify the unassigned code point set name. When more than one character set is specified, they apply in order (from left to right). The following can be set in <set>.
- <version>
- Prohibited character set described in the specific version of NAMEPREP. For available verison numbers, refer to
nameprep
.fileset:
<pathname>>- The definition for unassigned code points is loaded from <pathname>file For information on how to include descriptions in the file, refer to Set File Format.
[Setting example]
nameprep-unassigned nameprep-07
encoding-alias-file
The encoding code set name can be added as an alias. In this example, the path name to the alias definition file to be added is specified.
[Syntax]
encoding-alias-file
<path>
Specify the path name to the definition file to <path>.
[Setting example]
encoding-alias-file /some/where/mdnalias.txt
The alias definition file is a plain text file and one alias name is set in each line. The format for each line is as follows.
<Alias> <Original name>
Instead of encoding name <Original name>, <Alias> becomes available.
local-map
This entry is used to specify local mapping applied to domain names before NAMEPREP is applied. This mapping can be specified separately for each top level domain (TLD) of domain names.
[Syntax]
local-map
<TLD> <scheme> ...
Specify TLD for which mapping applies in <TLD> and the mapping scheme name in <scheme>, respectively.
When more than one scheme is specified, they apply in order (from left to right).
The schemes that can be specified are the same as for nameprep-map
.
[Setting example]
local-map .jp filemap:/some/where/jp.map local-map - filemap:/some/where/notld.map local-map . filemap:/some/where/default.map
Specifying hyphen ('-
') for TLD means that mapping applies to domain names without TLD, that is, domain names without periods ('.
').
In the same way, when a period is specified for TLD, mapping applies to domain names that do not match any of the TLDs of other local-map
entries.
Except when the TLD is a period ('.
'), the period at the beginning of a TLD can be omitted.
delimiter-map
This entry is used to specify the character used to map a period.
Normally, a period ('.
') is used as a delimiter between labels of domain names. The character specified in this entry can be used as the delimiter in instead of a period.
[Syntax]
delimiter-map
<code point> ...
Use a hexadecimal to describe the Unicode code point in <code point>.
[Setting example]
delimiter-map 3002
Local Encoding
There is no entry for setting local encoding in the configuration file because it is automatically determined by referencing the locale or environment variable.
However, the following cases cannot automatically be sensed.
- When an application that does not use the
setlocate()
function is executed - When an application is executed as a C locale
- When the relationship between locale and encoding is not known
Specify the MDN_LOCAL_CODESET
environment variable to set local encoding. For example, to set local encoding to EUC-JP, set the following settings beforehand.
[Setting example]
sh(Shell) Series:
$ MDN_LOCAL_CODESET=EUC-JP $ export MDN_LOCAL_CODESETcsh(Shell) Series:
% setenv MDN_LOCAL_CODESET EUC-JP
The value to be specified is a local encoding name that must be specified using a name that is accepted by the iconv()
function in the system (or more precisely iconv_open()
). This name differs with the iconv
implementation; refer to the iconv
document for details.
If you only use a single type of local encoding, it is recommended that you save this setting in .profile
or .cshrc
.
Map File Format
The map file defines character mapping rules for nameprep-map
and local-map
entries.
You can specify one character as the source and a string of 0 or more characters as mapped characters.
Mapping relying on the context that the mapping rules change according to the front and rear characters cannot be performed.
The map file is a plain text file and one mapping rule is written in each line. The mapping rule is written in the following format.
<Source code point>; <Mapped code point string>;
Use hexadecimal to describe Unicode code points of source characters in <Source code point>. Write Unicode code point values for each character in the mapped character string in <Mapped code point string> in hexadecimal. Arrange from the beginning of the characters in order using a space as the delimiter. When the mapped character is a blank character string, <Mapped code point string> is blank.
[Setting example]
# Map "A" to "a" 0041; 0061; # Do not map "#" 0023; ; # Map "@" to "at" 0040; 0061 0074;
Set File Format
The set file defines a set of Unicode code points that cannot be used as domain names for nameprep-prohibit
and nameprep-unassigned
entries.
The set file is a plain text file. Write one code point in each line or write the code point range. The format is as follows.
<Code point>
<Starting code point>-<Ending code point>
Use hexadecimal to describe Unicode code points for code points.
Lines that begin with '#'
and blank lines are ignored.
[Setting example]
# Prohibit tilde symbols 007E # Prohibit control characters 0000-001F 007F-000F # Prohibit characters other than Basic Multilingual Plane (BMP) of Unicode 10000-10FFFF