runmdn

 

概要

Overview

runmdn は BIND-4 あるいは BIND-8 をベースとした リゾルバライブラリを持つクライアントを、 再コンパイルなしに多言語ドメイン名を扱えるようにするためのコマンドです。

The runmdn command allows clients that use a BIND-4 or BIND-8 based resolver library to support multilingual domain names without re-compiling.

起動

Invoke

% runmdn コマンド [引数...]
% runmdn Command [Argument...]

例えば telnet コマンドで多言語ドメイン名を扱うためには 次のようにします。

For example, multilingual domain names can be supported using a telnet command as follows.

% runmdn telnet ログイン.どこかの会社.jp
% runmdn telnet ログイン.どこかの会社.jp

実装

Implementation

runmdn は共有ライブラリのプリロード機構を用いて、標準の リゾルバライブラリに含まれる関数の一部を、多言語ドメイン名の処理機能を持つ 別のバージョンに動的に置換えることで、クライアントでの多言語ドメイン名の 処理を実現します。

runmdn implements processing of multilingual domain names by the client using the pre-load mechanism of the common library, and dynamically replaces a part of function included in the standard resolver library with another version that has a multilingual domain name processing function.

多くのシステムでは共有ライブラリのプリロードは環境変数 LD_PRELOAD を用いて実現されています。この環境変数にプリロードしたい 共有ライブラリファイルのパス名を指定すると、クライアントの実行時に、 アプリケーションに標準の共有ライブラリがリンクされる前に 指定したライブラリがリンクされます。これによって標準のライブラリ関数を 置換えることができます。

In many systems, pre-loading of the common library is implemented using an environmental variable LD_PRELOAD. By specifying the path name of the common library file to pre-load in this environmental variable, when the client executes, the specified library is linked before the standard common library of the application is linked. Because of this, the standard library function can be replaced.

したがって、runmdn の実体は、この環境変数を設定し、引数で 指定されたコマンドを起動するだけのシェルスクリプトであり、実際に 多言語ドメイン名の処理を行うのはアプリケーションにリンクされる 共有ライブラリ libmdnresolv です。

Therefore, in reality runmdn is a shell script that sets this environmental variable and invokes the commands specified by arguments, and actual multilingual domain name processing is performed by the shared library libmdnresolv linked to the application.

libmdnresolv をリンクすることにより、BIND4 あるいは BIND8 ベースの リゾルバライブラリで用いられている次の関数が置き換わります。

By linking libmdnresolv, the following functions used by BIND4 or BIND8 based resolver library are replaced.

dn_comp
dn_expand
res_hnok
res_ownok
res_mailok
res_dnok

それぞれの変更点を簡単に記述します。

Changes in each function are briefly explained below.

dn_comp
指定されたドメイン名を DNS プロトコルで用いられるドメインデータに変換する前に、 ローカルコードセットから DNS プロトコル上で用いられるエンコーディングへの 変換および正規化、(必要ならば) ZLDの付加を行います。
Before the specified domain name is converted to the domain data for the DNS protocol, conversion from local encoding to the code set used by the DNS protocol and normanization, and addition of ZLD (if necessary) are performed.
dn_expand
DNS プロトコルで用いられるドメインデータをドメイン名文字列に変換した後、 (必要なら) ZLD を削除し、ローカルコードセットへの変換を行います。 また通常この関数はドメイン名に含まれる ASCII 以外の文字を バックスラッシュエスケープする処理をしますが、これを抑制します。
After the domain data used in DNS protocol is converted to the domain name text string, deletion of ZLD (if necessary) and conversion to local code set are performed. Usually, this function applies backslash escape to non-ASCII characters but this processing is suppressed.
res_hnok
どんな文字でも正当な文字であると判断するようにします。
All characters are determined to be valid.
res_ownok
どんな文字でも正当な文字であると判断するようにします。
All characters are determined to be valid.
res_mailok
どんな文字でも正当な文字であると判断するようにします。
All characters are determined to be valid.
res_dnok
どんな文字でも正当な文字であると判断するようにします。
All characters are determined to be valid.

エンコーディング変換や正規化、ZLD の処理等はすべて MDN ライブラリ (libmdn) の res モジュールを使用しています。

For all processing such as encoding conversion, normalization and ZLD, res module of MDN library (libmdn) is used.

現在の実装では libmdnresolv は MDN ライブラリ (libmdn) を 呼び出すのではなく、libmdn 自体を内部に抱え込むような形態になっていますが、 これは単なる実装上の都合からそうなっているだけで、論理的には MDN ライブラリの機能を呼び出しているといってよいでしょう。
In the current implementation, libmdnresolv does not call the MDN library (libmdn) but holds libmdn itself internally. This is for convenience in implementation, but logically, the MDN library function is being called.

また使用するエンコーディングや正規化の設定は クライアント設定ファイルの設定を 利用します。

Also, use "setup"in client configuration filefor encoding or normalization setup.

制限

Restrictions

runmdn にはいくつかの制限があり、どんなシステムでも使えるわけでは ありません。

There are certain restrictions on runmdn and it cannot be used in every system.