gai.conf

Section: File Formats (5)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

gai.conf - getaddrinfo(3) 設定ファイル  

説明

getaddrinfo(3) の呼び出しでは、複数の答えが返る場合がある。 RFC 3484 によれば、 これらの答えは、 最も成功の可能性が高い答えがリストの先頭になるような順番に並び替えなければならない。 RFC には、 並び替えのアルゴリズムが書かれている。 しかしながら、 静的なルールが常に適切という訳ではない。 この理由から、 RFC では、 並び替え方法をシステム管理者が動的に変更できるようにすることも要求している。 glibc の実装では、 /etc/gai.conf ファイルでこれが実現できるようになっている。

Each line in the configuration file consists of a keyword and its parameters. White spaces in any place are ignored. Lines starting with '#' are comments and are ignored.

現在のところ、認識されるキーワードは以下の通りである。

label~netmask~label
The value is added to the label table used in the RFC 3484 sorting. If any label definition is present in the configuration file, the default table is not used. All the label definitions of the default table which are to be maintained have to be duplicated. Following the keyword, the line has to contain a network mask and a label value.
precedence~netmask~precedence
このキーワードは label に似ているが、 指定された値を RFC 3484 で規定された優先度テーブルに追加する点が異なる。 繰り返しになるが、 設定ファイルに precedence が一つでもあれば、デフォルトテーブルは使用されない。
reload~<yes|no>
This keyword controls whether a process checks whether the configuration file has been changed since the last time it was read. If the value is "yes", the file is reread. This might cause problems in multithreaded applications and is generally a bad idea. The default is "no".
scopev4~mask~value
Add another rule to the RFC 3484 scope table for IPv4 address. By default, the scope IDs described in section 3.2 in RFC 3484 are used. Changing these defaults should hardly ever be necessary.
 

ファイル

/etc/gai.conf  

バージョン

gai.conf ファイルは glibc 2.5 以降でサポートされている。  

例

RFC 3484 で規定されているデフォルトテーブルは、 以下の設定ファイルを指定するのと同じである。

label  ::1/128       0
label  ::/0          1
label  2002::/16     2
label ::/96          3
label ::ffff:0:0/96  4
precedence  ::1/128       50
precedence  ::/0          40
precedence  2002::/16     30
precedence ::/96          20
precedence ::ffff:0:0/96  10

glibc includes some extra rules in the label table for site-local addresses, ULA, and Teredo tunnels. Its default label table is:

label ::1/128        0
label ::/0           1
label 2002::/16      2
label ::/96          3
label ::ffff:0:0/96  4
label fec0::/10      5
label fc00::/7       6
label 2001:0::/32    7
 

関連項目

getaddrinfo(3), RFC 3484


 

Index

名前
説明
ファイル
バージョン
例
関連項目

This document was created by man2html, using the manual pages.