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