mDN Wrapper
Overview
To support multilingual domain names on 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 developer.
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 mdnsproxy 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 when 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.-
ConfFile REG_SZ
- This is the path name of the mDNkit configuration file
mdn.conf
that describes parameters with respect to multilingual domain name processing. The path name of the configuration file can be changed using the Configuration program. -
LogFile REG_SZ
- This is the path name of the log file. This can also be changed using the Configuration program.
-
Where REG_DWORD
- This is the value used to specify with which part of WINSOCK, conversion is performed. This can be changed using Configuration program. This value is set appropriately by default so changing this value is not required usually.
-
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\Program name\Where
REG_DWORD
Conversion location PerProg\Program name\Encoding
REG_SZ
Encoding name
-
- 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.
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.
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.
Then, specify the local encoding of the program. Select "Default" for the standard setting. Select UTF-8 only if the program supports international encoding.
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.
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.
When use of mDN Wrapper is canceled for a program, the program is no longer displayed in the first window list box.
Use the "Unwrap All" button to cancel use of mDN Wrapper for all currently selected programs.
Re-applyiing mDN Wrapper
When mDN Wrapper version is upgraded, the program needs to be applied once again in order to update the wrapper DLL. Use the "Rewrap All" button to re-apply mDN Wrapper to all programs that are currently wrapped at once.
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.
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 trace messages besides error.
- 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.
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. This mode may work well except for Windows 2000.
- 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.1.
- 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. Windows 2000 operates correctly in this mode.
Usually, the appropriate value is automatically set based on the OS. However, depending on the version of WINSOCK being used, the setting may not work correctly and the value will probably need to be set manually.
The path name of the mDNkit configuration file mdn.conf
can be specified at the middle of the panel.
In addition, the "Edit" button can be used to start the Notepad to edit the file.
The settings become effective by clicking the "OK" button. Click "Cancel" button 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 the 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 domain 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. mDN Wrapper cannot be applied to such programs in a standard install or configuration.
Applications installed in the same folder that contains WINSOCK DLL
When mDN Wrapper is applied to an application installed in the same folder (system directory) that contains WINSOCK DLL, it is recommended that you copy the program into a different folder, then apply mDN Wrapper to the copied program.
It is very dangerous to install mDN Wrapper in the system directory. It is possible that the system cannot reboot.
mdnsproxy, an alternate solution
mdnsproxy 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, mdnsproxy 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.
- If mDNkit version 1.x is already installed, uninstall it.
When mDNkit version 1.x is already installed, if a new version of mDNkit is installed, both mDNkit 1.x and 2.x entries are appeared as applications list in "Add/Remove Programs". If mDNkit version 1.x is uninstalled in this situation, the files necessary to run the new version of mDNkit are also removed, so it is necessary to install a new version of mDNkit again. For preventing from this situation, if mDNkit version 1.x is installed, uninstall it before installing a new version of mDNkit. - 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, start the configuration file, execute "Rewrap All", then apply mDN Wrapper again.