Imported Debian patch 1:1.05-8
[hcoop/zz_old/debian/djbdns.git] / debian / djbdns-man / qualification.5
CommitLineData
b4588d5c
GP
1.TH qualification 5
2
3.SH NAME
4qualification \- User's guide to name qualification
5
6.SH OVERVIEW
7.B Qualification
8means conversion
9of a short host name that you type, such as
10.IR cheetah ,
11into a complete (``fully qualified'') domain name,
12such as
13.IR cheetah.heaven.af.mil .
14
15This page explains the djbdns qualification procedure.
16These rules are followed by the
17.I dns_ip4_qualify
18library routine in djbdns,
19and by programs that use the
20.BR dns_ip4_qualify (3)
21routine.
22
23.SH Rewriting instructions
24Normally the djbdns qualification procedure
25follows instructions listed in
26.IR /etc/dnsrewrite ,
27a file created by your system administrator.
28You can override
29.I /etc/dnsrewrite
30by creating your own file
31and setting the
32.I $DNSREWRITEFILE
33environment variable
34to the name of that file.
35
36Sample instructions:
37
38 # anything.local -> me
39 -.local:me
40 # me -> 127.0.0.1
41 =me:127.0.0.1
42 # any.name.a -> any.name.af.mil
43 *.a:.af.mil
44 # any-name-without-dots -> any-name-without-dots.heaven.af.mil
45 ?:.heaven.af.mil
46 # remove trailing dot
47 *.:
48
49Instructions are followed in order, each at most once.
50There are four types of instructions:
51.TP
52.RI = post\fR:\fInew\fR
53means that the host name
54.I post
55is replaced by
56.IR new .
57.TP
58.RI * post\fR:\fInew\fR
59means that any name of the form
60.I prepost
61is replaced by
62.IR prenew .
63.TP
64.RI ? post\fR:\fInew\fR
65means that any name of the form
66.IR prepost ,
67where
68.I pre
69does not contain dots or brackets,
70is replaced by
71.IR prenew .
72.TP
73.RI - post\fR:\fInew\fR
74means that any name of the form
75.I prepost
76is replaced by
77.IR new .
78
79.SH Searching
80
81The djbdns qualification procedure
82can search through DNS for several possible qualifications of a name.
83For example, the name
84
85cheetah+.heaven.af.mil+.af.mil
86
87is qualified as
88.I cheetah.heaven.af.mil
89if that name has IP addresses listed in DNS,
90or
91.I cheetah.af.mil
92otherwise.
93
94In general,
95.IR x +\fIy1\fR+\fIy2\fR+\fIy3\fR
96is qualified as
97.I xy1
98if
99.I xy1
100has IP addresses listed in DNS;
101otherwise, as
102.I xy2
103if
104.I xy2
105has IP addresses listed in DNS;
106otherwise, as
107.IR xy3 .
108You can list any number of +'s.
109
110Searching is applied after rewriting,
111so you can use a rewriting instruction such as
112
113?:+.heaven.af.mil+.af.mil
114
115to have
116.I lion
117qualified as
118.I lion.heaven.af.mil
119or
120.IR lion.af.mil ,
121and
122.I tiger
123qualified as
124.I tiger.heaven.af.mil
125or
126.IR tiger.af.mil ,
127and so on.
128
129Searching is generally not a recommended feature.
130If you rely on
131.I gw
132being qualified as
133.IR gw.af.mil ,
134and someone suddenly adds a new
135.IR gw.heaven.af.mil ,
136you'll end up talking to the wrong host.
137It's better to rely on syntactic rules that you control.
138
139.SH Compatibility mechanisms
140If the rewriting-instructions file does not exist,
141the djbdns qualification procedure looks for a local domain name in three
142places:
143.TP
1441.
145the
146.I $LOCALDOMAIN
147environment variable, if it is set; or
148.TP
1492.
150the first
151.I domain
152or
153.I search
154line
155in
156.IR /etc/resolv.conf ,
157if
158.I /etc/resolv.conf
159exists and has such a line; or
160.TP
1613.
162everything after the first dot in the system's hostname.
163.P
164It then creates rewriting instructions of the form
165
166 ?:.\fIdomain\fR
167 *.:
168
169so that
170.RI . domain
171is added to any name without dots or brackets.
172
173You can specify searching in
174.I $LOCALDOMAIN
175by using several domain names separated by spaces.
176Your system administrator can specify searching in
177.I /etc/resolv.conf
178by putting several domains on a
179.I search
180line.
181
182.SH Compatibility notes
183Different DNS client programs use different qualification procedures.
184Two major differences between the djbdns qualification procedure
185and other qualification procedures:
186.IP
187Most programs use only
188.IR /etc/resolv.conf .
189They don't know anything about
190.I /etc/dnsrewrite
191and
192.IR $DNSREWRITEFILE .
193.IP
194Most long-running programs
195don't notice changes in
196.IR /etc/resolv.conf ;
197they read
198.I /etc/resolv.conf
199when they start,
200and they don't reread it until they are restarted.
201In contrast, the djbdns qualification procedure
202checks for changes every 10 minutes or 10000 uses.
203.P
204Two minor differences:
205.IP
206Some programs interpret a
207.I domain
208line in
209.I /etc/resolv.conf
210as specifying a search list consisting of various suffixes of the domain.
211.IP
212Many programs will search the local domain
213for names
214.I with
215dots.
216.P
217If you want the local domain searched for names with dots,
218you can set it up with rewriting:
219
220 # aol.com -> aol.com or aol.com.heaven.af.mil
221 *:++.heaven.af.mil
222 # but skip directly to heaven.af.mil if no dots
223 ?++.heaven.af.mil:.heaven.af.mil
224
225.SH SEE ALSO
226dnsipq(1)
227
228http://cr.yp.to/djbdns.html