クライアント設定ファイル

Client Configuration File


概要

Overview

クライアント設定ファイルは、多言語ドメイン名のための各種の設定が 記述されているファイルで、mDNkit を使用して多言語化 (国際化) したクライアント側のリゾルバが読み込むファイルです。 このファイルは MDN ライブラリの resconf モジュール によって読み込まれ、 多言語ドメインに関する以下のような設定ができます。

The client configuration file is the file in which various settings for multilingual domain names are described. This file is loaded by the resolver at the client side 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 settings related to multilingual domains can be made.

このファイルは通常のテキストファイルで、ファイルの各行 (# で始まるコメント行と、空行を除いて) は、 次のような単純なフォーマットで構成されます。

This file is a standard text file and each line of the file (except comment lines starting with # and blank lines) consists of following simple format.

キーワード 値...
Keyword  Value...

クライアント設定ファイルは、mDNkit をデフォルトの設定でコンパイルした 場合には以下に配置されます。

The client configuration file is located as follows when the mDNkit is compilied using the default settings.

/usr/local/etc/mdnres.conf

以降、各キーワードごとに設定内容を記述します。

The setting content is discussed below for each keyword.

サーバエンコーディングエントリ

Server Encoding Entry

DNS プロトコル上の多言語ドメイン名のエンコーディングとして使用する エンコーディング (コードセット名) を指定します。

Specifies encoding (code set name) used as the encoding for multilingual domain name in the DNS protocol.

[構文]
server-encoding encoding
[Syntax]
server-encoding encoding

encoding には、使用するエンコーディング名を記述し、 次のものが指定できます。

The encoding name to be used is described in encoding and the following types can be specified.

このエントリは必須エントリであり、必ず記述しなければなりません。

This entry is a prerequisite and must always be described.

サーバ ZLD エントリ

Server ZLD Entry

DNS プロトコル上で使用される多言語ドメイン名のエンコーディング (server-encoding エントリで指定されたもの) の中には、多言語ドメイン名と従来の ASCII ドメイン名とを区別するために ZLD (zero-level domain) というドメインを必要とするものがあります。 ZLD は通常のトップレベルドメインのさらに上位ドメインに相当します。 ただしこれは DNS のシステム内部でのみ使われるドメインであり、 一般ユーザやアプリケーションからは見えないようになっています。

Of the encoding types (specified by server-encoding entry) for multilingual domain names used by the DNS protocol, some require a domain called ZLD (zero-level domain) in order to distinguish multilingual domain names from conventional ASCII domain names. ZLD is equivalent to a higher level domain that is above the usual top level domain. Note, however, that this domain is only used inside the DNS system and ordinary users and application cannot see this domain.

[構文]
server-zld ZLD
[Syntax]
server-zld ZLD

mDNkit のデフォルトの設定では、ZLD は使用できないようになっており、 設定ファイル中にこのエントリがあると警告メッセージが表示されます。 このエントリの指定を有効にするには、mDNkit の configure 実行時に --enable-zld オプションによって ZLD サポートを有効にしておく 必要があります。

ZLD cannot be used in the default settings of the mDNkit. When this entry exists in the configuration file, a warning message is displayed. To make this entry specification effective, it is necessary to use the --enable-zld option to make ZLD support effective when executing configuration of the mDNkit.

正規化エントリ

Normalization Entry

正規化エントリでは、DNS サーバに送る前にドメイン名に適用すべき 正規化の方式を指定します。

The normalization entry is used to specify the normalization scheme that should be applied to domain names before sending it to the DNS server.

[構文]
normalize scheme [scheme..]
[Syntax]
normalize scheme [scheme..]

scheme には、正規化形式を記述します。 以下のものが記述できます。

The normalization form is described in scheme. The following formats can be described.

ascii-lowercase
ASCII 大文字を小文字に変換
Converts uppercase ASCII to lowercase ASCII
ascii-uppercase
ASCII 小文字を大文字に変換
Converts lowercase ASCII to uppercase ASCII
unicode-lowercase
Unicode Technical Report #21: Case Mappings に基づいて、Unicode 大文字を小文字に変換
Converts uppercase Unicode to lowercase Unicode based on Unicode Technical Report #21: Case Mappings
unicode-uppercase
Unicode Technical Report #21: Case Mappings に基づいて、Unicode 小文字を大文字に変換
Converts lowercase Unicode to uppercase Unicode based on Unicode Technical Report #21: Case Mappings
unicode-form-c
Unicode Technical Report #15: Unicode Normalization Forms の「Form C」による正規化
Performs normalization using "Form C" of Unicode Technical Report #15: Unicode Normalization Forms
unicode-form-kc
Unicode Technical Report #15: Unicode Normalization Forms の「Form KC」による正規化
Performs normalization using "Form KC" Unicode Technical Report #15: Unicode Normalization Forms
ja-kana-fullwidth
日本語半角カナを全角カナに変換
Converts single-byte Japanese katakana to double-byte Japanese katakana
ja-alnum-halfwidth
日本語の全角英数字および全角マイナス記号を半角文字に変換
Converts double-byte Japanese alphanumeric characters and double-byte minus symbols to single-byte characters.
ja-compose-voiced-sound
日本語の全角かなとそれに続く濁点(゛)半濁点(゜)を 濁点・半濁点つきのかな1文字に変換
Converts double-byte Japanese katakana and following voiced consonant marks (゛) and circles attached to certain katakana (゜) to one katakana character attached with a voiced consonant mark or circle.
ja-minus-hack
日本語の全角マイナス記号(−)をハイフン(-)に変換
Converts double-byte Japanese minus symbols (−) to hyphens (-).
ja-delimiter-hack
日本語の句点(。)および全角ピリオド(.)をピリオド(.)に変換
Converts Japanese delimiters (。) and double-byte periods (.) to periods (.).

正規化形式には複数の形式が指定可能です。複数の形式が指定された場合、 順序通りに (左から右に) 適用されます。

More than one formats can be specified for the normalization method. When more than one method is specified, they are applied in the order indicated (from left to right).

代替エンコーディングエントリ

Alternate Encoding Entry

mDNkit で多言語化されたリゾルバライブラリは、 アプリケーションが使用しているローカルコードセットを自動的に決定し、 DNS の応答メッセージ中のドメイン名を、そのコードセットに変換しようとします。 しかし、ドメイン名に使用されているある文字がローカルコードセットに マップされていないために、変換に失敗することもあり得ます。 例えば日本語コードセットを使用している日本語のアプリケーションが、 日本語の文字セットに含まれていない中国語の文字を含んだ DNS 応答を受信したような時にこのようなことが起こります。

Resolver library that was made multilingual by the mDNkit automatically determines the local code set used by the application, and tries to convert the domain name in the response message of DNS to that code set. However, conversion may fail because some characters used for the domain name are not mapped in the local code set. For example, this happens when a Japanese application using the Japanese code set receives a DNS response that includes Chinese characters that are not included in the Japanese character set.

代替エンコーディングエントリは、上記のような問題が生じた時に ローカルコードセットの代わりに使用するコードセットを指定します。

The alternate encoding entry specifies a code set to be used instead of the local code set when the above type of problem occurs.

[構文]
alternate-encoding encoding
[Syntax]
alternate-encoding encoding

encoding はコードセット名で、RACE のような ASCII 互換エンコーディング を使用しなければなりません。

encoding is a code set name and ASCII-conpatible encoding such as RACE must be used.

エンコーディングエイリアスエントリ

Encoding Alias Entries

エンコーディングエイリアスエントリでは、コードセット名のエイリアスを 記述したファイルのパス名を記述します。

The encoding alias entry contains a description of the path to the file that describes the alias of the code set name.

[構文]
alias-file pathname
[Syntax]
alias-file pathname

pathname には、エイリアスファイルへのパス名を指定します。 このエイリアスファイルは通常のテキストファイルで、 以下のような形式の行から構成されます。

pathname specifies the path for the alias file. This alias file is usually a text file and consists of lines in the following format.

alias-name name

alias-name は定義されるエイリアス名で、name は 実際のコードセット名か、定義済のエイリアス名です。

alias-name is the defined alias name and name is the actual code set name or previously defined alias name.

ローカルコードセット

Local Code Set

クライアント設定ファイルにはローカルコードセットを指定するエントリは 存在しません。 ローカルコードセットはアプリケーションがそのときに使用している ロケールの情報から決定されるからです。 ですから、それぞれのアプリケーションがそれぞれ異なるローカルコードセットを 使用することができますし、同一アプリケーションが複数のローカルコードセットを 切り替えながら使用することも可能です。

The client configuration file does not have an entry used to specify local code set. This is because the local code set is determined based on the locale information used by the application at that time. Therefore, each application can use a different local code set and also a single application can use more than one local code sets by switching between them.

mDNkit はロケール情報からアプリケーションの使用しているローカルコードセットを 推測しようとしますが、時には失敗することもあります。 例えば、C ロケールで動作しているにも関わらず 非 ASCII コードセットを使用しているアプリケーションではロケール情報から ローカルコードセットを判定することは不可能ですし、mDNkit が知らない ロケールで動作するアプリケーションの場合にも推測に失敗するでしょう。

mDNkit tries to guess the local code set used by the application based on locale information but it sometimes fails to do so. For example, though an application may run in the C locale, if the application uses a non-ASCII code set it is impossible to determine the local code set from the locale information. Also, mDNkit will fail when it attempts to guess the local code set an application uses if it does not understand the locale information.

このような場合のために、環境変数 MDN_LOCAL_CODESET によって アプリケーションのローカルコードセットを強制指定することができるように なっています。 この変数にコードセット名 (もしくはそのエイリアス名) を指定すると、mDNkit はロケールの設定に関わらず、指定したコードセットを ローカルコードセットとして動作します。

In such cases, the MDN_LOCAL_CODESET environmental variable can be used to forcefully specify the local code set used by the application. When the code set name (or its alias name) specifies this variable, mDNkit operates using the specified code set as the local code set regardless of the locale setting.

コンフィギュレーションファイル記述例

Configuration File Description Example

以下に、コンフィギュレーションファイルの記述例を示します。

Description examples of the configuration file are shown below.

#
# a sample configuration.
#

# DNS プロトコル上のエンコーディングとして RACE を使用する
# Uses RACE as encoding for the DNS protocol
server-encoding RACE

# 正規化の手順として、小文字に変換した後、KC 正規化法を使用する
# For the normalization procedure, converts to lowercase and then 
# uses the KC normalization method 
normalize unicode-lowercase unicode-form-kc

# 代替エンコーディングとして RACE を使用する
# Uses RACE for alternate encoding 
alternate-encoding RACE