DNS Proxy Server dnsproxyを使うには、いくつかの情報を設定する必要があります。ここでは、これらの情報の設定方法と意味とを説明します。
A number of data items have to be set up to allow use of dnsproxy, the DNS Proxy Server. This draft describes the procedure for setup, and its significance.
設定情報はコンフィギュレーションファイルに記載されます。コンフィギュレーションファイルは、dnsproxyの起動時にコマンドラインで指示することができます。
The setup data can be found in the configuration file. The configuration file can be specified on the command line when dnsproxy starts up.
コマンドラインで指示しなかった場合にはデフォルトのコンフィギュレーションファイルが使用されます。 デフォルトのコンフィギュレーションファイルは、ディレクトリ When not specified on the command line, the default configuration file can be used. The default configuration file is found under the following directory.% dnsproxy -config <config-file>
/usr/local/etcの下の
dnsproxy.confです。ディレクトリは、mDNkit作成時に
configure --sysconfdir=DIRThis directory can be specified when the mDNkit is generated.
configure --sysconfdir=DIRで指示することもできます。 詳しくは、インストールガイドの configure 実行の ところをご覧ください。 For details, refer to the installation guide: Configure and implement
コンフィギュレーションファイルはテキストファイルで、以下のコンフィギュレーションデータを指定します。
The configuration file is a text file and specifies the following configuration data.
dnsproxyがクライアントからの要求を受付けるネットワークアドレス、ポート番号を指定します。
Specifies the network address and port number dnsproxy needs in order to receive client queries.
listen <address><address>は以下のいずれかの形式で指示します。
省略された場合には
<IP address>:<port number> :<port number> <IP address>
が使用されます。
IP address 0.0.0.0 # INADDR_ANY port number 53
dnsproxy経由でDNSサーバを使用するクライアントは、ここで指示したアドレス、ポートをDNSサーバとして設定します。 クライアント側ではポート番号を変更できないものが多いのでポート番号はデフォルトの53をそのまま使った方がよいでしょう。
Clients that use a DNS server via dnsproxy will set up the address and port of the DNS server here. Because most clients cannot usually change the port number, it is best to use default port number 53.
dnsproxyが、DNS要求を転送し、応答を受け取る本来のDNSサーバのネットワークアドレス、ポート番号を指定します。
dnsproxy transfers DNS queries and specifies the network address and port number of the DNS server that is to receive the response.
forward <address> [ bind4compat ]<address>の形式は上のlistenのものと同じです。 <address>The address format is the same as that of listen above.
オプションの bind4compatが指示された場合には、UDPでリクエストを転送する時に、ソースアドレスとして、listenで指示されたアドレス/ポートを使用します。 これはbind4にある機能で、UDPポートについてのアクセス制限下で運用することを想定したものです。このオプションが指示されなかった場合には、1024以上のソースポートが使用されます。
When the option bind4compat is specified, the address and port specified by listen is used as the source address when a request is transferred using UDP. This is a bind4 function and assumes that UDP port access is limited. A source port greater than 1024 is used when this option is not specified.
dnsproxyが実行ログを出力するファイル名を指定します。
Specifies the name of the file that contains the execution log output by dnsproxy.
log-file <path>ログファイル名は、以下のコマンドラインオプションで指定することもできます。 両方指定した場合にはコマンドラインオプションの指定のほうが優先されます。
The log file name can also be specified using the following command line option. When both are entered, the command line option takes precedence.
dnsproxy -logfile <address>指定されなかった場合には、
When not specified,
/tmp/dnsproxy.logに書き込まれます。
is written.
なお、実行ログは常に追記されていきますので、適当な時を見計らって消すことをお勧めします。
Note that the execution log is added to continuously and should be deleted from time to time.
また、dnsproxy にハングアップシグナル (SIGHUP) を送るといったんログファイルを閉じて、再度オープンするようになっています。ログファイルをアーカイブする場合に便利な機能です。
When a hangup signal (SIGHUP) is sent to dnsproxy, it temporarily closes the log file and then reopens it. This is a convenient command when the log file is to be archived.
ログのレベルを設定します。
Specifies the log level.
log-level <level>レベルとして指定できる値は次の通りです。
The following log level values can be specified.
- none
- 一切ログを記録しません。ログがないと不具合が生じた場合の 原因解明が難しくなりますので、できればこのレベルは指定しないでください。
- none
- No log is recorded. The absence of a log file makes it very difficult to identify the cause of a problem. If possible do not use this level.
- fatal
- 致命的なエラーが生じたときにのみログを出力します。
- fatal
- Outputs a log only when a fatal error occurs.
- warn
- 警告メッセージにもログに記録します。これがログレベルを 指定しなかったときのデフォルトです。
- warn
- Records warning messages in the log. This is the default used when no log level is specified.
- trace
- 実行トレースメッセージもログに出力します。 このレベルを指定すると dnsproxy の動作がかなり詳細に記録されるので障害が発生した場合の原因究明には便利ですが、大量のログが出力されるので普段は指定しない方がよいでしょう。
- trace
- Outputs execution trace messages in the log. This level provides a detailed record of dnsproxy operation, which is helpful in determining the cause of a problem. As it records a large amount of data, it is best not used during normal operation.
- client-translation
クライアント側でのドメイン名のエンコーディングを指示します。
Specifies the domain name encoding to be used on the client side.client-translation <ZLD> <Encoding>多言語ドメイン名に対応していないクライアントの場合には、通常、クライアントのローカルエンコーディングになっています。そのような場合には
For clients that do not support multilingual domain names, the local encoding of the client is normally used. In such a case, the following format is used without <ZLD>.client-translation . Shift_JISという形で、<ZLD>無しで指示します。
多言語ドメイン名の手法によっては、クライアント側で多言語ドメイン名を通常のDNSでも受付けられる形式にエンコードして、それを通常のドメイン名と区別するために ZLD (Zero Level Domain) を付加するものがあります。そのような場合には、付加されるZLDとその時のドメイン名のエンコーディング方法とを対応付けることにより、他の多言語ドメイン名手法のDNSサーバを利用することができるようになります。
Some multilingual domain name schemes encode multilingual domain names in the client into a format that normal DNS can accept, and adds ZLD (Zero Level Domain) to distinguish it from regular domain names. Since the added ZLD and the domain name encoding scheme are interrelated, they can also be used with DNS servers using a different multilingual domain name scheme.
client-translation .i-dns.net UTF-5クライアント側のドメイン名のエンコーディングは、ZLD が異なっていれば、複数指定することができます。Multiple domain name encoding schemes can be used in a client if each scheme has its own unique \ZLDs.
なお、mDNkit のデフォルトの設定では ZLD の指定はできないようになっています。ZLD を使用するためには、mDNkit のコンパイルの際、configure コマンドに --enable-zldを指定する必要があります。この指定をせずに mDNkit をコンパイルした場合には、ZLD の指定はすべて無視されます。
Note that ZLD cannot be specified in the default setting of mDNkit. To use a ZLD, --enable-zld must be specifed using the configure command when mDNkit is compiled. All ZLD settings are ignored unless this specification is made when mDNkit is compiled.
クライアントから送られてきたDNS要求のドメイン名は、ここで指示したエンコーディングから、内部的に使用されるUTF-8エンコーディングに変換されます。 そして、後述の正規化、サーバ側エンコーディングへの変換が行なわれてDNSサーバに送出されます。また、DNSサーバからの応答は、逆に元のエンコデーィングに戻されてクライアントに返されます。
The encoding of domain names in the DNS query sent by the client is converted to UTF-8 encoding that is used internally. Then normalization (described below) and conversion to server side encoding are performed after which the data is sent to the DNS server. The response from the DNS server is converted back to the original encoding and returned to the client.
ここで指定可能なエンコーディング名は、mDNkit付属のlibmdnおよび使用するiconv ライブラリに依存します。 iconv ライブラリによって、エンコーディング名が異なっていることがありますので、ライブラリのマニュアルをご覧になって使用可能なエンコーディング名を確認してください。
The encoding names that can be used here depend on libmdn and iconv, mDNkit libraries. Since the encoding name used differs with the iconv library that is employed, check the library manual to confirm the encoding names that can be used. In addition to the enconding provided by iconv, libdmn supports the following encoding schemes recommended for multilingual DNS.
をサポートしています。
UTF-5 draft-jseng-utf5-01.txt RACE draft-ietf-idn-race-02.txt BRACE draft-ietf-idn-brace-00.txt LACE draft-ietf-idn-lace-00.txt
- alternate-encoding
DNS サーバから返されたドメイン名がクライアントのローカルエンコーディングに変換できない文字を含んでいた場合に、ローカルエンコーディングの代わりに使用するエンコーディングを指定します。
Specifies the encoding to be used in place of local encoding when the domain name returned by the DNS server contains characters that cannot be converted to the local encoding of the client.
alternate-encoding <Encoding>指定するエンコーディングは必ず「ASCII互換エンコーディング (ACE)」と呼ばれる、変換結果が従来のドメイン名として使用可能な文字 (英数字およびハイフン) だけからなるエンコーディングでなければなりません。たとえば ASCII 互換エンコーディングの一つである RACE を指定する場合には次のように指定します。The specified encoding must be ASCII compatible encoding (ACE) so that the result of conversion is in an encoding that contains only characters that can be used in traditional domain names (alphanumerics and hyphens). For example, this is how to specify RACE, one of the ASCII compatible encoding schemes.
alternate-encoding RACE
- normalize
ドメイン名の正規化手法を指定します。
Specifies the normalization scheme to be used for domain names.
normalize <scheme> ...正規化手法は複数指定可能で、左側から順に適用されていきます。A number of normalization schemes can be indicated, and they will be used in order from left to right.
クライアントから送られてきたDNS要求のドメイン名は、内部的に使用されるUTF-8エンコーディングに変換された上で、ここで指示した正規化が適用されます。 使用可能な正規化手法はmDNkitに含まれるlibmdnに依存しています。 どのような正規化手法があるかは、libmdnのマニュアルのnormalizer モジュールに記載されています。
When the domain name in the DNS query sent by the client has been converted to UTF-8 encoding for internal use, they are normalized according to the normalization scheme specified here. The normalization schemes that can be used depends on the libmdn in the mDNkit. Available normalization schemes are described in the Normalizer Module in the libmdn manual.
- server-translation
DNSサーバ側のドメイン名エンコーディング方法を指示します。
Specifies domain name encoding schemes to be used on the DNS server side.
server-translation <ZLD> <Encoding>ZLDが不要なエンコーディングであれば、省略値として'.'を指示します。
Specifies '.' as the default when ZLD is not necessary.
server-translation . UTF-8ZLDを必要するエンコーディングでは、ZLDとエンコーディング名の両方を指定します。When ZLD is required, specify both ZLD and the encoding name.server-translation .i-dns.net UTF-5指定可能なエンコーディングは、前出のclient-translationでのものと同じです。The encoding that can be specified is the same as for client-translation above.
- user-id
dnsproxy が動作するユーザを指定します。
Specifies user that uses dnsproxy.
user-id <user>通常、dnsproxy は特権ポートを使用するためルート権限で起動させる必要がありますが、ルート権限のままで動作させるのはセキュリティ上好ましくありません。この指定により、dnsproxy は特権ポートを作成したあとサービスを開始する前に指定したユーザの権限で動くようになります。
Normally, dnsproxy must be started up with root permission to use a privileged port, but continued use of root permission is not recommended for security reasons. With this specification, dnsproxy runs under the user's control with a privileged port before start of service.
<user> にはユーザ名あるいはユーザ ID 番号を指定することができます。
<user> allows you to specify user name or user ID number.
- group-id
dnsproxy が動作するグループを指定します。
Specifies group that uses dnsproxy.
group-id <user>これは user-id エントリと似ていますが、ユーザの代わりにグループを指定する点が異なります。
This resembles the user-id entry, but differs from it in that it specifies a group in place of the user.
<group> にはグループ名あるいはグループ ID 番号を指定することができます。
<group> can be specified by a group name or group ID number.
- root-directory
dnsproxy が動作する際のルートディレクトリを指定します。
Specifies the root directory used with dnsproxy.
root-directory <path>これもセキュリティ対策の一つです。dnsproxy が動作する際のルートディレクトリ を指定することで、そのディレクトリの外にはアクセスできないようにします。 この指定により、dnsproxy はサービスを開始する前に、chroot()システムコールを用いて指定したディレクトリをルートディレクトリとして設定します。
This, also, is a security measure. By specifying the root directory used with dnsproxy access cannot be made outside of this directory. This specification causes dnsproxy to use chroot() system calls to set the specified directory as the root directory before starting service.
<path> にはルートとして設定したいディレクトリ名を指定します。
<path> specifies the name of the directory to be used as the root.