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