CONTRIBUTING.d/patches: Please provide a git-range-diff(1)
[man-pages.git] / man5 / gai.conf.5
blobf7dfd07a86852a93043575a0349b3686e9981601
1 .\" Copyright (C) 2006 Red Hat, Inc. All rights reserved.
2 .\" Author: Ulrich Drepper <drepper@redhat.com>
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-only
5 .\"
6 .TH gai.conf 5 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 gai.conf \- getaddrinfo(3) configuration file
9 .SH DESCRIPTION
10 A call to
11 .BR getaddrinfo (3)
12 might return multiple answers.
13 According to RFC\ 3484 these answers must be sorted so that
14 the answer with the highest success rate is first in the list.
15 The RFC provides an algorithm for the sorting.
16 The static rules are not always adequate, though.
17 For this reason,
18 the RFC also requires that system administrators should have the possibility
19 to dynamically change the sorting.
20 For the glibc implementation, this can be achieved with the
21 .I /etc/gai.conf
22 file.
24 Each line in the configuration file consists of a keyword and its parameters.
25 White spaces in any place are ignored.
26 Lines starting with \[aq]#\[aq] are comments and are ignored.
28 The keywords currently recognized are:
29 .TP
30 \fBlabel\fR \fInetmask\fR \fIprecedence\fR
31 The value is added to the label table used in the RFC\ 3484 sorting.
32 If any \fBlabel\fR definition is present in the configuration file,
33 the default table is not used.
34 All the label definitions
35 of the default table which are to be maintained have to be duplicated.
36 Following the keyword,
37 the line has to contain a network mask and a precedence value.
38 .TP
39 \fBprecedence\fR \fInetmask\fR \fIprecedence\fR
40 This keyword is similar to \fBlabel\fR, but instead the value is added
41 to the precedence table as specified in RFC\ 3484.
42 Once again, the
43 presence of a single \fBprecedence\fR line in the configuration file
44 causes the default table to not be used.
45 .TP
46 \fBreload\fR <\fByes\fR|\fBno\fR>
47 This keyword controls whether a process checks whether the configuration
48 file has been changed since the last time it was read.
49 If the value is
50 "\fByes\fR", the file is reread.
51 This might cause problems in multithreaded
52 applications and is generally a bad idea.
53 The default is "\fBno\fR".
54 .TP
55 \fBscopev4\fR \fImask\fR \fIvalue\fR
56 Add another rule to the RFC\ 3484 scope table for IPv4 address.
57 By default, the scope IDs described in section 3.2 in RFC\ 3438 are used.
58 Changing these defaults should hardly ever be necessary.
59 .SH FILES
60 \fI/etc/gai.conf\fR
61 .SH VERSIONS
62 The
63 .I gai.conf
64 .\" Added in 2006
65 file is supported since glibc 2.5.
66 .SH EXAMPLES
67 The default table according to RFC\ 3484 would be specified with the
68 following configuration file:
70 .in +4n
71 .EX
72 label  ::1/128       0
73 label  ::/0          1
74 label  2002::/16     2
75 label ::/96          3
76 label ::ffff:0:0/96  4
77 precedence  ::1/128       50
78 precedence  ::/0          40
79 precedence  2002::/16     30
80 precedence ::/96          20
81 precedence ::ffff:0:0/96  10
82 .EE
83 .in
84 .\" .SH AUTHOR
85 .\" Ulrich Drepper <drepper@redhat.com>
86 .\"
87 .SH SEE ALSO
88 .BR getaddrinfo (3),
89 RFC\ 3484