メインコンテンツへジャンプする

JPNICはインターネットの円滑な運営を支えるための組織です

ロゴ:JPNIC

WHOIS 検索 サイト内検索 WHOISとは? JPNIC WHOIS Gateway
WHOIS検索 サイト内検索

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.

  • Since runmdn uses the dynamic link mechanism of the shared library, the system must be able to use the shared library.
  • Also, the system must have a library pre-load function using the LD_PRELOAD environment variable or similar mechanism.
  • The target commands of runmdn must dynamically link the resolver library.
  • When the system's library does not provide an iconv() function, an external library is used. This library must be a shared library.
  • The application must use the above functions for name resolution.
  • For security reasons, generally speaking setuid commands cannot use a pre-load function, therefore, the command must not be setuid.

このページを評価してください

このWebページは役に立ちましたか?
よろしければ回答の理由をご記入ください

それ以外にも、ページの改良点等がございましたら自由にご記入ください。

回答が必要な場合は、お問い合わせ先をご利用ください。

ロゴ:JPNIC

Copyright© 1996-2025 Japan Network Information Center. All Rights Reserved.