runmdn


Overview

The runmdn command allows UNIX clients that use the standard resolver functions such as gethostbyname to support multilingual domain names without re-compiling.

In addition, since mdnsproxy ignores the setting of the environment variable MDN_DISABLE explicitly ,in spite of whether the environment variable MDN_DISABLE is set or not, the conversion of the domain names is performed.


Invocation

% runmdn [Option...] Command [Argument...]

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

% runmdn telnet {U+79C1 U+306E U+4F1A U+793E}.jp

Options

runmdn recognizes the following options.

-e Local Encoding
Specifies a local encoding of application. If this option is not specified, it performs auto determination of local encoding from locale and environment variables. Refer to the section Local Encoding in mDNkit Configration about details of auto determination.

Implementation

runmdn implements processing of multilingual domain names by the client using the pre-load mechanism of the shared library, and dynamically replaces a part of functions for standard name resolution with another version that has a multilingual domain name processing function.

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

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

By linking libmdnresolv, the following name resolving functions used by many systems are replaced.

gethostbyname
gethostbyname_r
gethostbyname2
gethostbyname2_r
gethostbyaddr
gethostbyaddr_r
getipnodebyname
getipnodebyaddr
getaddrinfo
getnameinfo

Accompanying replacement of the above functions, in addition the following functions are also replaced for memory management reasons.

freehostent
freeaddrinfo

Compared to the original functions, the following functions are added.

  1. Converts the domain name specified by the argument from the local code set to an encoding used by internationalized DNS and also performs normalization such as NAMEPREP.
  2. Converts the encoding of the domain name returned from the DNS to the local code set.

All encoding conversion and normalization processing uses res module in MDN library (libmdn).

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 the mDNkit configuration file in the client configuration file for encoding or normalization setup.


Limitations

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