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.
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 はmDNkit の設定時にオプションで変更が可能です。/usr/local/etc/mdnres.conf
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.
コンフィギュレーションファイルは通常のテキストファイルで、以下のコンフィギュレーションデータを指定します。
The configuration file is a text file, and specifies the following configuration data.
Specifies the encoding used by a DNS protocol.
server-encoding encodingencoding にエンコーディング名を指定します。 encoding specifies the encoding name.
なお、アプリケーション側のローカルエンコーディングはロケールによって決まるので、client-encoding というエントリはありません。 ローカルエンコーディングに関しては後述します。
- [設定例]
- [Setting example]
server-encoding RACE server-encoding UTF-8
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 ZLDZLD で使用する ZLD を指定します。
ZLD is used to specify ZLD.
- [設定例]
- [Setting example]
server-zld zld.to.be.used
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 caseascii-uppercase ASCII の小文字を大文字に正規化
Normalizes lower case ASCII as upper caseunicode-lowercase Unicode の大文字を小文字に正規化
Normalizes Unicode upper case as lower caseunicode-uppercase Unicode の小文字を大文字に正規化
Normalizes Unicode lower case as upper caseunicode-form-c Unicode normalization form C unicode-form-kc Unicode normalization form KC ja-kana-fullwidth 半角カナ文字を全角カナ文字に正規化
Normalizes half-width kana as full-width kanaja-alnum-halfwidth 全角英数字およびマイナス記号を半角文字に正規化
Normalizes full-width alphanumerics and minus symbol as half-width charactersja-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 encodingencoding に代替エンコーディングの名称を指定します。 Enter the name of the alternate encoding in encoding.
代替エンコーディングは、ASCII 互換エンコーディングでなくてはなりません。
The alternate encoding must be an ASCII-compatible encoding.
- [設定例]
- [Setting example]
alternate-encoding RACE
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 pathpath に定義ファイルのパス名を指定します。 Enter the definition file path in path.
別名の定義ファイルは通常のテキストファイルであり、1行に1つずつ別名を定義します。各行の形式は次の通りです。
- [設定例]
- [Setting example]
alias-file /some/where/mdnalias.txt
The alias definition file is a normal text file in which one alias is defined on each line. The line format is as follows.
エンコーディング名 <元の名前> の代わりに <別名> が使えるようになります。 <an alias> can be used instead of the encoding name <original name><別名> <元の名前> <alias> <original name>
ローカルエンコーディングについては、ロケールから推測して自動判定するため、コンフィギュレーションファイルでは、ローカルエンコーディングを設定するエントリはありません。
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.