mDN Wrapper
Overview
To support multilingual domain nameson Windows, the name encoding of the 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 developers.
However, as no standard is yet in place, this is too hard 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 section, we will introduce another tool, the mDN Wrapper.
Queries to resolve domain names on Windows are often passed to WINSOCK DLL. It will be possible for existing programs to support multilingual domain names, by replacing WINSOCK DLL with one that supports multilingual domain names.
Setup
*Note:* If an old version of mDN Wrapper is already installed on your machine, read the Precautions in Upgrading before installing the new version.
Execute "setup.exe" to install mDN Wrapper. The setup program does the following.
- Installing files
- Copy the file containing mDN Wrapper to the \Program Files\JPNIC\mDN Wrapper (can be changed at setup) directory.
- Registry Setup
- Create the required registry key and registry values under HKEY_LOCAL_MACHINE\Software\JPNIC\MDN. The major items are as follows.
- Encoding REG_SZ
- 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 (if multiple names are specified they must be separated by space). 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 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 informations are set.
PerProg\<progname>\Where | REG_DWORD | Conversion location |
PerProg\<progname>\Encoding | REG_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, you must set conversion location for fitting your environment by using registry editor.
- Creating Icons
- Create a configuration program icon and place it in the Start menu. You can start up the configuration program by using it.
To uninstall the program, select "mDN Wrapper" in Add/Remove Programs in the Control Panel and click the Add/Remove button.
Configuration Program
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](img/wrapper_config1.jpg)
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.
Applying mDN Wrapper
Press the "Wrap.." button to wrap a program using mDN Wrapper. Pressing the "Wrap.." button displays the following dialog box.
![Configuration Wrap](img/wrapper_config2.jpg)
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](img/wrapper_config3.jpg)
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](img/wrapper_config4.jpg)
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](img/wrapper_config5.jpg)
Canceling use of mDN Wrapper
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](img/wrapper_config6.jpg)
When use of mDN Wrapper is canceled for a program, the program is no longer displayed in the first window list box.
![Configuration Unwrapped](img/wrapper_config7.jpg)
Use the "Unwrap All" button to cancel use of mDN Wrapper for all currently selected programs.
Log setting
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](img/wrapper_config8.jpg)
The following log levels can be selected.
- None
- Outputs no log at all. This is the default setting.
- Fatal
- Outputs a log only when a fatal error occurs.
- Error
- Also outputs a log for non-fatal as well as fatal errors.
- Warning
- Also outputs warning messages.
- Info
- Also outputs other information, in addition to errors.
- Trace
- Also outputs program trace information. Note that a large amount of information is output when this level is selected.
These log levels are for logs output by the mDN library. Because the own mDN Wrapper log can only be set to "on" or "off," "None" turns off the log entirely other cases turns on the log.
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.
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.
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
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](img/wrapper_config9.jpg)
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
- 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
- Uses mDN Wrapper only for calls from WINSOCK 1.1 but not from WINSOCK 2.0.
- Wrap only WINSOCK 2.0
- 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
- 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 may be used.
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.
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.
The settings become effective by clicking the OK button. Click Cancel to close the dialog box without changing the settings.
Limitations
- DLL Version
-
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 not work when a different version of WINSOCK
DLL is installed.
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
- On Windows, not only DNS but also WINS and LMHOSTS resolve domain names and host names. When mDN Wrapper is used, domain name conversions are not dispatched to these schemes but are performed at a higher level. So the name conversions are performed these all methods. 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.
- Resolving for other names than domain names.
-
The following are WINSOCK 2.0 name resolving APIs:
WSALookupServiceBeginW WSALookupServiceNextW WSALookupServiceEnd 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.Because the mDN Wrapper converts encodings of any type of names, these APIs could cause problems if used for resolving names other than domain names. - Programs not using name resolving API
- 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 does not work for such applications.
- Applications tied to specific WINSOCK DLLs
-
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 applyed to such programs in a standard install or configuration.If mDN Wrapper must be applyed 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 Windows system restart.
- dnsproxy, an alternate solution
-
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.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. But it is perhaps best used as an alternative to Wrapper to avoid the above limitations.
Precautions when Upgrading
Note the following when a new version of the software is to be installed in a machine containing an earlier version.
-
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. -
Rewrapping 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.