1GAI.CONF(5)                Linux Programmer's Manual               GAI.CONF(5)
2
3
4

NAME

6       gai.conf - getaddrinfo(3) configuration file
7

DESCRIPTION

9       A  call  to getaddrinfo(3) might return multiple answers.  According to
10       RFC 3484 these answers must be sorted so that the answer with the high‐
11       est  success  rate is first in the list.  The RFC provides an algorithm
12       for the sorting.  The static rules are  not  always  adequate,  though.
13       For  this  reason,  the  RFC  also  requires that system administrators
14       should have the possibility to dynamically change the sorting.  For the
15       glibc implementation, this can be achieved with the /etc/gai.conf file.
16
17       Each  line  in  the  configuration  file  consists of a keyword and its
18       parameters.  White spaces in any place  are  ignored.   Lines  starting
19       with '#' are comments and are ignored.
20
21       The keywords currently recognized are:
22
23       label netmask precedence
24              The value is added to the label table used in the RFC 3484 sort‐
25              ing.  If any label definition is present  in  the  configuration
26              file,  the default table is not used.  All the label definitions
27              of the default table which are  to  be  maintained  have  to  be
28              duplicated.   Following  the  keyword, the line has to contain a
29              network mask and a precedence value.
30
31       precedence netmask precedence
32              This keyword is similar to label, but instead the value is added
33              to  the  precedence table as specified in RFC 3484.  Once again,
34              the presence of a single precedence line  in  the  configuration
35              file causes the default table to not be used.
36
37       reload <yes|no>
38              This  keyword controls whether a process checks whether the con‐
39              figuration file has been changed since  the  last  time  it  was
40              read.   If  the  value is "yes", the file is reread.  This might
41              cause problems in multithreaded applications and is generally  a
42              bad idea.  The default is "no".
43
44       scopev4 mask value
45              Add  another  rule to the RFC 3484 scope table for IPv4 address.
46              By default, the scope IDs described in section 3.2  in  RFC 3438
47              are  used.  Changing these defaults should hardly ever be neces‐
48              sary.
49

FILES

51       /etc/gai.conf
52

VERSIONS

54       The gai.conf file is supported by glibc since version 2.5.
55

EXAMPLES

57       The default table according to RFC 3484 would  be  specified  with  the
58       following configuration file:
59
60           label  ::1/128       0
61           label  ::/0          1
62           label  2002::/16     2
63           label ::/96          3
64           label ::ffff:0:0/96  4
65           precedence  ::1/128       50
66           precedence  ::/0          40
67           precedence  2002::/16     30
68           precedence ::/96          20
69           precedence ::ffff:0:0/96  10
70

SEE ALSO

72       getaddrinfo(3), RFC 3484
73

COLOPHON

75       This  page  is  part of release 5.07 of the Linux man-pages project.  A
76       description of the project, information about reporting bugs,  and  the
77       latest     version     of     this    page,    can    be    found    at
78       https://www.kernel.org/doc/man-pages/.
79
80
81
82Linux                             2020-06-09                       GAI.CONF(5)
Impressum