mDNkit リゾルバのコンフィギュレーション

mDNkit Resolver Configuration

mDNkit が提供するツール、コマンドのうち、dnsproxy 以外のもの、つまり runmdn と mdnconv は共通の設定ファイルを参照します。 また bind9 パッチも同じ設定ファイルを参照します。

runmdn and mdnconv, commands and tools that the mDNkit provides in addition to dnsproxy, reference the shared configuration file. The bind9 patch also references the same configuration file.

このファイルには mDNkit を利用したクライアントあるいはリゾルバが必要とするいくつかの情報を設定する必要があります。 例えば正規化の方式や DNS プロトコル上で用いられるドメイン名のエンコーディング方法などをこのファイルで指定します。 ここでは、これらの情報の設定方法と意味とを説明します。

A number of data items that the client or resolver needs, in order to be able to use the mDNkit, must be entered in this file. For example, the normalization scheme and the domain name encoding scheme in the DNS protocol are specified in this file. The procedure for entering this data, and its significance, are described below.

また、アプリケーションの使用するローカルエンコーディングはアプリケーションの動作するロケール情報から取得します。これについても合わせて説明します。

The local encoding used by the application is acquired from the locale information of the application.


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

Configuration File

mDNkit の設定は、コンフィギュレーションファイルによって行われます。 mDNkit をデフォルトの設定でコンパイルした場合には、このコンフィギュレーションファイルのパス名はとなります。

mDNkit is set up using the configuration file. When mDNkit is compiled in the default setting, the path name of the configuration file becomes the following.

/usr/local/etc/mdnres.conf
ディレクトリ部分、つまり /usr/local/etc はmDNkit の設定時にオプションで変更が可能です。

The directory, /usr/local/etc, can be changed using option when setting up the mDNkit.

mDNkit をインストールすると、このファイルのサンプルファイルが(デフォルトの設定の場合) にインストールされます。

When mDNkit is installed, a sample file of this file is installed (when the default setting is used).

/usr/local/etc/mdnres.conf.sample
このサンプルファイルには設定項目とその説明が書かれていますので、コンフィギュレーションファイル作成の参考にしてください。

This sample file contains the setting items and their descriptions. Use this information as reference in generating the configuration file.


コンフィギュレーションデータ

Configuration Data

コンフィギュレーションファイルは通常のテキストファイルで、以下のコンフィギュレーションデータを指定します。

The configuration file is a text file, and specifies the following configuration data.

server-encoding
DNS プロトコルが使用するエンコーディングを指定します。

Specifies the encoding used by a DNS protocol.

server-encoding encoding
encoding にエンコーディング名を指定します。 encoding specifies the encoding name.
[設定例]
[Setting example]
server-encoding RACE
server-encoding UTF-8
なお、アプリケーション側のローカルエンコーディングはロケールによって決まるので、client-encoding というエントリはありません。 ローカルエンコーディングに関しては後述します。

The local encoding used by the application is determined by the locale so there are no client-encoding entries. Local encoding is described in the Section below.

server-zld
ZLD を指定します。ZLD とは Zero Level Domain の略で、server-encoding に UTF-5 など特殊なエンコーディングを指定した場合に必要となります。ZLD についてはDNSサーバの設定ZLD の指定の記述が参考になるでしょう。 なお、mDNkit をデフォルトの設定でコンパイルした場合には ZLD は使えず、このエントリを指定しても無視されます。 ZLD が使えるように mDNkit をコンパイルする方法についてはインストールドキュメントの--enable-zld の項をご覧ください。
Specifies ZLD. ZLD, which is short for Zero Level Domain, is required when UTF-5 or other special encoding is used in the server-encoding. Refer to ZLD Settings in DNS Server Setup for information on ZLD. Note that when mDNkit is compiled in the default setting that ZLD cannot be used and that this entry will be ignored. Refer to the Section --enable-zldin the Install for instructions on how to compile mDNkit so that ZLD can be used.
server-zld ZLD
ZLD で使用する ZLD を指定します。

ZLD is used to specify ZLD.

[設定例]
[Setting example]
server-zld zld.to.be.used

normalize
このエントリーでは正規化の方法を指定します。 2 つ以上の正規化の方法が指定された場合、順番通り (左から右に) 適用します。

This entry specifies the normalization scheme to be used. When 2 or more normalization schemes are specified, this will apply in order from left to right.

normalize scheme...
scheme で正規化の方式の名称を指定します。

scheme specifies the normalization scheme to be used.

正規化の方式として以下のものが指定できます。

The normalization schemes listed below can be specified.

ascii-lowercase ASCII の大文字を小文字に正規化
Normalizes upper case ASCII as lower case
ascii-uppercase ASCII の小文字を大文字に正規化
Normalizes lower case ASCII as upper case
unicode-lowercase Unicode の大文字を小文字に正規化
Normalizes Unicode upper case as lower case
unicode-uppercase Unicode の小文字を大文字に正規化
Normalizes Unicode lower case as upper case
unicode-form-c Unicode normalization form C
unicode-form-kc Unicode normalization form KC
ja-kana-fullwidth 半角カナ文字を全角カナ文字に正規化
Normalizes half-width kana as full-width kana
ja-alnum-halfwidth 全角英数字およびマイナス記号を半角文字に正規化
Normalizes full-width alphanumerics and minus symbol as half-width characters
ja-compose-voiced-sound 全角ひらがなカタカナとそれに続く濁点半濁点を1文字にまとめる正規化
Normalizes full-width hiragana, katakana with voicing and aspirating signs as one character.
ja-minus-hack 全角マイナス記号をハイフン ('-') に正規化
Normalizes full-width minus symbol as a hyphen ('-').
ja-delimiter-hack 全角ピリオドおよび句点を半角のピリオド ('.') に正規化
Normalizes full-width periods and punctuation marks as half-width period ('.').
[設定例]
[Setting example]
normalize unicode-lowercase unicode-form-kc 
alternate-encoding
このエントリーでは代替エンコーディングの形式を指定します。 代替エンコーディングとは、DNS プロトコル上のエンコーディングからアプリケーション側のローカルエンコーディングへの変換に失敗した時に、ローカルエンコーディングの代わりに使用されるエンコーディングです。 例えば日本語を扱うアプリケーションに DNS サーバから韓国のハングル文字を含むドメイン名が返された場合には、日本語のローカルエンコーディングに変換できないので、代わりにこの代替エンコーディングに変換された結果が渡されます。
This entry determines the alternate encoding format. Alternate encoding is used in place of local encoding when a conversion from DNS protocol encoding to the local encoding on the application side fails. For example, when a domain name that includes Korean characters is returned from a DNS server to an application that handles Japanese. Since the domain name cannot be converted to Japanese local encoding, it is converted to alternate encoding before the result is passed to the application.
alternate-encoding encoding
encoding に代替エンコーディングの名称を指定します。 Enter the name of the alternate encoding in encoding.

代替エンコーディングは、ASCII 互換エンコーディングでなくてはなりません。

The alternate encoding must be an ASCII-compatible encoding.

[設定例]
[Setting example]
alternate-encoding RACE
alias-file
エンコーディングのコードセット名を、別名として追加することができます。 ここでは、追加する別名の定義ファイルへのパス名を指定します。

The encoding code set name can be entered as an alias. Here, we will enter the path name of the alias definition file to be added.

alias-file path
path に定義ファイルのパス名を指定します。 Enter the definition file path in path.
[設定例]
[Setting example]
alias-file /some/where/mdnalias.txt
別名の定義ファイルは通常のテキストファイルであり、1行に1つずつ別名を定義します。各行の形式は次の通りです。

The alias definition file is a normal text file in which one alias is defined on each line. The line format is as follows.

<別名>     <元の名前>
<alias>     <original name>
エンコーディング名 <元の名前> の代わりに <別名> が使えるようになります。 <an alias> can be used instead of the encoding name <original name>

ローカルエンコーディングについて

Local Encoding

ローカルエンコーディングについては、ロケールから推測して自動判定するため、コンフィギュレーションファイルでは、ローカルエンコーディングを設定するエントリはありません。

There is no entry for setting local encoding in the configuration file because it is automatically determined by referencing the locale on the local machine.

ただし、以下のようなケースのときには自動判定ができません。

However, the following cases cannot be automatically sensed.

このような場合には環境変数 MDN_LOCAL_CODESET を設定することで、ローカルエンコーディングの設定を行うことができます。 例えばローカルエンコーディングを EUC-JP に設定する場合には、あらかじめ次のような設定をしておきます。

Specify the MDN_LOCAL_CODESET environment variable to set local encoding. For example, to set local encoding to EUC-JP, make the following setting beforehand.

[設定例]
sh 系のとき
$ MDN_LOCAL_CODESET=EUC-JP
$ export MDN_LOCAL_CODESET
csh 系のとき
% setenv MDN_LOCAL_CODESET EUC-JP

指定する値はローカルエンコーディング名で、これはシステムのiconv() 関数 (より正確には iconv_open()) が受け付ける名前で指定します。この名前は iconv の実装によってそれぞれ異なりますので、具体的な値については iconv のドキュメントを参照してください。

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.

もしあなたが単一のローカルエンコーディングしか使用していないのであれば、このような設定を .profile.cshrc 等に入れておくことをお勧めします。

If you only use a single type of local encoding, it is recommended that you save this setting in .profile or .cshrc.