mDN Wrapper


概要

Overview

Windows で多言語ドメイン名を扱えるようにするためには、Windows 上のクライアントアプリケーションにおいて、解決しようとする名前のエンコーディングを、DNS サーバが受付ける形式のものに変換する必要があります。これは、Windows 上のアプリケーションが、きちんと多言語ドメイン名を扱えるようになっていなければならない、ということであり、本来はそれぞれのプログラムの作成者が行なうべきことです。

To enable Windows to support multilingual domain names, the name encoding that client applications resolve must be converted to a format that DNS servers can accept. This requires accurate handling of multilingual domain names by Windows applications, which is basically the responsibility of each program developer.

しかし、標準が決まっていない現状では、プログラム作成者にこのような対応を期待するのは無理なので、既存のアプリケーションを多言語ドメイン名対応させるためのトリックが必要になります。mDNkitに含まれるdnsproxyサーバはそのための一つの方法です。 ここでは、もう一つの方法、mDN Wrapper を提示します。

However, as no standard is yet in place, this is too much to expect of program developers at this time. Therefore, a trick is needed so that existing applications will be able to support multilingual domain names. The dnsproxy server supplied with the mDNkit is one such tool. In this draft, we will introduce another tool, the mDN Wrapper.

Windows において、多くの場合、ドメイン名解決の要求はWINSOCK DLLに渡されます。そこで、WINSOCK DLL を多言語ドメイン名対応のものに置き換えてやれば、既存のプログラムからでも多言語ドメイン名を使うことができるようになります。

Queries to resolve domain names in Windows are often passed to WINSOCK DLL. By replacing WINSOCK DLL with one that supports multilingual domain names, it will be possible for existing programs to support multilingual domain names.


セットアップ

Setup

*注意* もし古いバージョンの mDN Wrapper がすでにインストールされているマシンに新しいバージョンをインストールする場合には、まずバージョンアップ時の注意をご覧ください。

*Note:* If an old version of mDN Wrapper is already installed, read the Precautions in Upgrading before installing the new version.

mDN Wrapper をインストールするには"setup.exe" を実行します。セットアッププログラムは次のような処理を行います。

Use "setup.exe" to install mDN Wrapper. The setup program does the following.

ファイルのインストール
Installing files
ディレクトリ「\Program Files\JPNIC\mDN Wrapper」セットアップで変更可能)以下に、mDN Wrapper を構成するファイルをコピーします。

Copy the file containing mDN Wrapper to the 「\Program Files\JPNIC\mDN Wrapper」(can be changed at setup) directory.

レジストリの設定
Registry Setup

HKEY_LOCAL_MACHINE\Software\JPNIC\MDN 以下に必要なレジストリキー、レジストリ値を作成、設定します。主なものは次の通りです。

Create the required registry key and registry values under HKEY_LOCAL_MACHINE\Software\JPNIC\MDN. The major items are as follows.

Encoding REG_SZ
DNS サーバ側のエンコーディング名です。 デフォルト値は "RACE" で、これは現時点での有力候補であるRACEエンコーディングの指定です。 エンコーディング名は コンフィギュレーションプログラムで変更することができます。

An encoding name used on the DNS server side. The default value is "RACE", which is currently the leading encoding scheme. The encoding name can be changed using the configuration program.

Normalize REG_SZ
ドメイン名の正規化の方式です。使用する正規化の名称 (複数指定する場合にはスペースで区切る) を指定します。 デフォルトは日本語ドメイン名の正規化として適当だと思われる値になっています。 これも コンフィギュレーションプログラムで変更することができます。

A domain name normalization scheme used to specify normalization names (multiple names must be separated by spaces). It is set to a default value that is considered appropriate for normalization of Japanese domain names. This value can also be changed using configuration program.

PerProg キー
PerProg key
プログラム毎の設定値を格納するためのキーです。 この下に、プログラムの実行モジュール名をキーとしてプログラム個別の設定が記録されます。設定される情報は以下の二つです。

A key used to store values set for each program. Program specific setting is stored with its executable module name used as a key. The following two types of infomration is set.

PerProg\<progname>\WhereREG_DWORD変換位置
Conversion location
PerProg\<progname>\EncodingREG_SZエンコーディング名
Encoding name

エンコーディング名は通常コンフィギュレーションプログラムによって設定されます。 変換位置の指定は、標準インストールでは不要です。 システムディレクトリへのインストールを行なった場合には、レジストリエディタで環境に合わせて設定する必要があります。

The encoding name is normally specified by the configuration program. The conversion location is not required for a standard installation. When the program is installed in the system directory, the registry editor must be used to adjust the environment.

アイコンの作成
Creating Icons

コンフィギュレーションプログラムのアイコンを作成し、スタートメニューに登録します。これによってコンフィギュレーションプログラムを起動することができます。

Create a configuration program icon and place it in the Start menu. This icon allows you to start up the configuration program.

アンインストールするには、コントロールパネルの「アプリケーションの追加と削除」で、「mDN Wrapper」を選択して削除(「追加と削除」ボタン)します。

To uninstall the program, select "mDN Wrapper" in Add/Remove Programs in the Control Panel and click the Add/Remove button.


コンフィギュレーションプログラム

Configuration Program

コンフィギュレーションプログラムは、アプリケーションを特定して mDN Wrapper を適用したり、適用を解除するためのツールです。

The configuration program is a tool for specifying applications that are to be wrapped or unwrapped.

起動すると以下のような画面が表示されます。

The screen shown below appears when the program is started.

Configuration Startup

リストボックスには、その時点で mDN Wrapper が適用されているプログラムが表示されます。最初に実行した場合には空になっています。右側のボタンを押すことにより、操作を行うことができます。

The list box shows programs that mDN Wrapper is currently wrapping. The box is blank when the program first starts. Press the buttons on the right to begin.

mDN Wrapper の適用

Using mDN Wrapper

プログラムに mDN Wrapper を適用するには、"Wrap.."ボタンを押します。 "Wrap.."ボタンを押すと以下のようなダイアログが表示されます。

Press the "Wrap.." button to wrap a program using mDN Wrapper. Pressing the "Wrap.." button displays the following dialog box.

Configuration Wrap

最初に、mDN Wrapper を適用したいプログラムの実行ファイル名を設定します。 直接入力するか、ブラウズボタンでファイルを探してください。

First set the filename of the program that mDN Wrapper is to wrap. Enter the name directly or use the Browse button to find the file.

Configuration Browse

次にそのプログラムのローカルエンコーディングを指定します。 通常は「Default」 でかまいません。 プログラムが国際化エンコーディングに従っている場合にのみ「UTF-8」 を指示します。

Then, specify the local encoding of the program. Select "Default" for the standard setting. Select UTF-8 only if the program supports international encoding.

Configuration Encoding

最後に "Wrap" ボタンを押せば、そのプログラムに対して指定されたエンコーディングで mDN Wrapper が適用されます。 適用されたプログラムは、最初のウィンドウのリストボックスに反映されます。

Then press the Wrap button to use mDN Wrapper with the specified encoding for the selected program. The wrapped program is displayed in the list box in the first window.

Configuration Wrapped

mDN Wrapper の解除

Canceling use of mDN Wrapper

プログラムに対する mDN Wrapper の適用を解除するには、リストボックスで解除するプログラムを選択して、"Unwrap.." ボタンを押します。 以下の確認用のダイアログが表示されますので、間違いがなければ "Unwrap" ボタンを押してください。

To cancel the use of mDN Wrapper for a program, select the program in the list box and click the Unwrap button. The confirmation dialog box shown below is displayed. If this is correct, click the Unwrap button.

Configuration Unwrap

mDN Wrapper の適用が解除されると、そのプログラムは最初のウィンドウのリストボックスからも削除されます。

When use of mDN Wrapper is canceled for a program, that program is no longer displayed in the first window list box.

Configuration Unwrapped

"Unwrap All" ボタンを押すことによって、現在適用されているすべてのプログラムに対して mDN Wrapper の適用を解除することもできます。

Use the Unwrap All button to cancel use of mDN Wrapper for all currently selected programs.

ログ設定

Log setting

"Log.." ボタンを押すことによってログレベルやログファイルを設定することができます。このボタンを押すと次のようなダイアログが現れます。

Click the "Log.." button to set a log level or log file. The dialog box shown below is displayed when this button is clicked.

Configuration Log

ログレベルは次の中から選ぶことができます。

The following log levels can be selected.

None
ログを一切出力しません。これがデフォルトです。
None
Outputs no log at all. This is the default setting.
Fatal
致命的エラーのみ出力します。
Fatal
Outputs a log only when a fatal error occurs.
Error
致命的でないエラーも出力します。
Error
Outputs a log for non-fatal as well as fatal errors.
Warning
警告メッセージも出力します。
Warning
Also outputs warning messages.
Info
エラー以外の情報も出力します。
Info
Also outputs other information, in addition to errors.
Trace
プログラムのトレース情報も出力します。このレベルを選択すると大量のログが出力されるので気をつけてください。
Trace
Also outputs program trace information. Note that a large amount of information is output when this level is selected.
なお、このログレベルは MDN ライブラリ が出力するログに対するものです。mDN Wrapper 自体が出力するログについてはON/OFF 以外のレベルを指定することはできず、None を指定すればオフに、それ以外のレベルを指定すればオンになります。

These log levels are for logs output by the mDN library. Because the mDN Wrapper log can only be set to "on" or "off," "None" turns off the log entirely (however, it is "on" in all other cases).

ログファイルを指定することも可能です。デフォルトでは mDN Wrapper をインストールしたディレクトリの "mdn_wrapper.log" になっています。 "Browse.." ボタンを押せばブラウズ用のダイアログを利用して選択することができます。

A log file can also be specified. The default setting is mdn_wrapper log and is stored in the directory where mDN wrapper is installed. Click the Browse button to select the file from the Browse dialog box.

また、このダイアログではログファイルの内容を見ることと、ログファイルを削除することが可能です。それぞれ "View"、"Delete" ボタンを押してください。 "View" ボタンを押すとメモ帳が起動して、ログファイルの内容を表示します。

This dialog box can also be used to view and delete the log file. Use the View or Delete buttons to do this. When the View button is clicked, NotePad opens displaying the contents of the log file.

"OK" ボタンを押すとダイアログの設定が有効になります。設定を変えたくない場合には "Cancel" ボタンを押してください。

Click the OK button to confirm the dialog settings. Click the Cancel button when none of the settings are to be changed.

詳細パラメータ設定

Detailed Parameters Settings

"Advanced.." ボタンを押すことにより、次のようなダイアログが表示されます。 これは上級ユーザのためのもので、適切なデフォルトが設定されているので通常ユーザが変更する必要のないような基本的なパラメータを変更することができます。

Click the "Advanced.." button to display the dialog box shown below. This is for experienced users; an appropriate default setting is provided for ordinary users to enable the change of basic parameters without the need for making detailed settings.

Configuration Advanced

ダイアログ最上部のパネルでプログラムに対する mDN Wrapper の適用モードを指定することができます。選択できる値とその意味は次の通りです。

The appropriate mDN Wrapper mode can be set in the panel at the top of the dialog box. Settings and their meanings are listed below.

Wrap both WINSOCK 1.1 and WINSOCK 2.0
WINSOCK 1.1 と 2.0 の両方の呼び出しについて mDN Wrapper を適用し、ドメイン名のエンコーディング変換や正規化を行います。通常はこのモードで使えば正しく動くはずです。
Uses mDN Wrapper to convert and normalize domain name encoding for calls from both WINSOCK 1.1 and 2.0. Select this mode for normal operation.
Wrap only WINSOCK 1.1
WINSOCK 1.1 の呼び出しについては mDN Wrapper を適用しますが、WINSOCK 2.0 の呼び出しについては適用しません。
Uses mDN Wrapper only for calls from WINSOCK 1.1 but not from WINSOCK 2.0.
Wrap only WINSOCK 2.0
WINSOCK 2.0 の呼び出しについては mDN Wrapper を適用しますが、WINSOCK 1.1 の呼び出しについては適用しません。
Uses mDN Wrapper only for calls from WINSOCK 2.0, but not for WINSOCK 1.0.
Wrap only WINSOCK 2.0 if it exists. Otherwise wrap only WINSOCK 1.1
WINSOCK 2.0 が存在すれば WINSOCK 2.0 の呼び出しについてのみ mDN Wrapper を 適用します。存在しない場合には WINSOCK 1.1 の呼び出しについて適用します。WINSOCK のバージョンによってはデフォルトでは正しく動かず、このモードを指定しなければならないかもしれません。
Uses mDN Wrapper only for calls from WINSOCK 2.0, if it exists. Otherwise, mDN Wrapper is used for calls from WINSOCK 1.1. The default setting may not function properly with some versions of WINSOCK, in which case this mode must be used.

中段のパネルでは正規化の方式を設定することができます。左側のリストボックスに使用する正規化の名称が入っており、右側のリストボックスには使用可能な正規化の名称が入っています。右側のリストボックスから追加したい正規化を選択し、"Add" ボタンを押すと左側のリストボックスに追加されます。 また、左側のリストボックスで削除したい正規化を選択して "Remove" ボタンを押せば削除することができます。"Clear" ボタンを押すとすべての正規化が削除され、また "Reset" ボタンによりデフォルトの設定に戻すことができます。

Normalization schemes can be set in the center panel. The left box lists the names of selected normalization schemes, while the box on the right lists the names of available normalization schemes. Select a normalization scheme from the right box; click the Add button to add it to the list in the left box. You can also delete normalization schemes from the left list box, by selecting it and clicking the Remove button. The Clear button removes all normalization schemes, and the Reset button reinstates the default settings.

3段目のパネルでは DNS サーバ側のエンコーディング名を指定することができます。 デフォルトは "RACE" ですが、他のエンコーディングを使用したい場合には ここで指定してください。

The third panel is used to enter the encoding name of the DNS server. The default setting is RACE, but this panel allows you set the desired encoding.

以上の設定は "OK" ボタンを押すことにより有効になります。設定を変えずにダイアログを終了したい場合には "Cancel" ボタンを押してください。

The settings become effective by clicking the OK button. Click Cancel to close the dialog box without changing the settings.


制限事項

Limitations

DLL バージョン
DLL Version

ラッパーDLL は、元のWINSOCK のDLL のバージョンに強く依存します。 これは、非公開のエントリも含めてすべてのエントリを提供する必要があるためです。 このためWINSOCK DLL のバージョンが変わると、mDN Wrapper が動作しなくなる可能性があります。

Wrapper DLL is highly dependent on the original WINSOCK DLL version. This is because all entries including non-public entries must be supplied. As a result, mDN Wrapper may stop functioning when a different version of WINSOCK DLL is installed.

今回作成されたmDN Wrapper は、

It has been confirmed that the current version of mDN Wrapper operates with the following software.

WinNT4.0 SP6a(WINSOCK 1.1 + 2.0)
Win98 (WINSOCK 1.1 + 2.0)
Win95 OSR2 (WINSOCK 1.1)
で動作を確認しています。ただ、将来にわたって動作する保証はありません。

There is no guarantee, however, that it will function in the future.

DNS, WINS, LMHOSTS

Windows では、DNS だけではなく、WINSやLMHOSTS によってもドメイン名、ホスト名の解決が行なわれます。 mDN Wrapper を使った場合には、ドメイン名の変換が、これらの方式へのディスパッチを行なう場所よりも上位層で行なわれるので、これらのすべての方式について、ドメイン名、ホスト名の変換が行なわれることになります。 このため、Windows が、WINSやLMHOSTS を使っている場合には、予期しない問題が発生する可能性があります。 これについては、mDN Wrapper を使う場合には、名前解決にDNS だけを使用することをお勧めします。

In Windows, not only DNS but also WINS and LMHOSTS resolve domain names and host names. When mDN Wrapper is used, domain name conversion are not dispatched to these schemes but are performed at a higher level. As a result, when Windows uses WINS or LMHOSTS, unexpected results may occur. Thus when you use mDN Wrapper, we recommend that only DNS is used for name resolving.

ドメイン名以外の名前の解決

WINSOCK 2.0 の名前解決API

The following are WINSOCK 2.0 name resolving APIs

WSALookupServiceBeginW
WSALookupServiceNextW
WSALookupServiceEnd
は、ドメイン名以外でも使用できる汎用の名前解決用のAPI として定義されています。 現時点では、これらはもっぱらドメイン名の解決で使用されていますが、他の名前(例えばサービス名)の解決にも使用できることになっています。

These are defined as a universal name resolving API that can be used for other than domain names. Currently, it is used only for resolving names, but it can also be used for resolving service names, for example.

mDN Wrapper は、名前の対象の如何にかかわらず、名前のエンコーディングを変換してしまうので、これらのAPI が、ドメイン名以外の解決に使われている場合には、問題を引き起こす可能性があります。

Because the mDN Wrapper converts encodings of any type of name, these APIs could cause problems if used for resolving names other than domain names.

名前解決API を使わないプログラム

Programs not using name resolving API

アプリケーションによっては、ドメイン名の解決にこれらのAPI を使用しないものもあります。例えば、'nslookup'は、これらのAPI を使用しないで、直接DNS サーバと通信してしまいます。このようなアプリケーションについては、mDN Wrapper は役に立ちません。

Some applications do not use these APIs for resolving domain names. For example, nslookup does not; instead, it communicates directly with the DNS server. mDN Wrapper cannot be used for such applications.

特定WINSOCK DLL にバインドされたアプリケーション

Applications tied to specific WINSOCK DLLs

アプリケーションによっては、標準のDLL サーチパスに従わないで、 特定のパスのDLL にバインドされているものがあります。 よく使われるプログラムの中では、Netscape Communicator がそうなっています。 このようなプログラムについては、標準のインストール/コンフィギュレーションでは mDN Wrapper を適用することはできません。

Some applications do not conform to standard DLL search paths, but are tied to a DLL of a specific path. An often used program, Netscape Communicator, is a case in point. mDN Wrapper cannot be added to such programs in a standard install or configuration.

このようなプログラムについて、どうしても mDN Wrapper を適用する必要があるなら、システムディレクトリへのインストールを行なうことができます。 ただし、このインストールは大変危険で、場合によってはシステムを再起動不能にしてしまう可能性もあります。

If mDN Wrapper must be added to this type of program, it can be installed under the system directory. However, such an installation is quite risky as it may sometimes make it impossible to restart.

代替手段としての'dnsproxy'

dnsproxy, an alternate solution

これらの制限事項が問題になる場合には、代替手段として'dnsproxy'を使うこともできます。これは、DNS サーバとのトランザクションを中継するので、上で問題になったようなことを回避することができます。

dnsproxy can be used as an alternate approach to avoid such limitations. The above problems are avoided since dnsproxy operates between the DNS server and the transaction.

ただし、'dnsproxy'は、ラッパーよりも複雑な設定が必要ですし、また、呼び元のプログラムを特定することができませんので、プログラム固有のローカルエンコーディングを取り扱うことはできません。しかし、上記の制限事項が問題になるようなケースでは、ラッパーの代わりに使用するといいかもしれません。

However, dnsproxy requires a more complex setup procedure than Wrapper and cannot identify a calling program so it cannot handle the local encoding of specific programs. It is perhaps best used as an alternative to Wrapper to avoid the above limitations.


バージョンアップ時の注意

Precautions when Upgrading

古いバージョンの mDN Wrapper がすでにインストールされているマシンに新しいバージョンをインストールする際には、次のことに気をつけてください。

Note the following when a new version of the software is to be installed in a machine containing an earlier version.

  1. インストールする前に古いバージョンをアンインストールする
    新しいバージョンをインストールする前に、古いバージョンをアンインストールしてください。そうしないと、新しいバージョンをインストールしてもいくつかのファイルが更新されず、古いまま残ってしまいます。 アンインストールするには、コントロールパネルの「アプリケーションの追加と削除」を実行し、「mDN Wrapper」を選択して削除を実行してください。
    もしアンインストールせずに新しいバージョンをインストールしてしまった場合には、 一度それをアンインストールしてから再度インストールを行ってください。

    Uninstall old version prior to installation.
    Before the most recent version is installed, uninstall the old version. Otherwise, a number of files will not be updated and the old version will remain in effect even though the latest version has been installed. To delete, open the Control Panel and select mDN Wrapper in Add/Remove Applications.
    If you made the mistake of installing the new version without first removing the old version, first uninstall, and then reinstall, the software.

  2. すべてのファイルを再度ラップする
    mDN Wrapper はその動作原理上、mDN Wrapper を適用するプログラムが存在するディレクトリにDLL をコピーします。 コピーされた DLL は新しいバージョンをインストールしても更新されないので、そのままでは新しいバージョンが使われません。このため、新しいバージョンをインストールしたら、一度 mDN Wrapper の適用をすべて解除し、改めて適用し直してください。すべてのプログラムに対する適用を解除するには、コンフィギュレーションプログラムの "Unwrap All" ボタンを使用するのが便利です。

    Re-wrapping all files
    mDN Wrapper copies a DLL file to the directory that contains programs that can be wrapped by mDN Wrapper. The copied DLL is not automatically updated to the latest version when a new version of the software is installed preventing use of the latest version. Therefore, after installation, unwrap all applications wrapped using mDN Wrapper and then wrap them again. The easiest way to do this is to click the Unwrap All button in the configuration program.