]> pere.pagekite.me Git - homepage.git/blob - reports/rfc/draft-gulbrandsen-dns-rr-srvcs-03.txt
Typo.
[homepage.git] / reports / rfc / draft-gulbrandsen-dns-rr-srvcs-03.txt
1
2 Applications Area Arnt Gulbrandsen
3 INTERNET-DRAFT Troll Technologies
4 <draft-gulbrandsen-dns-rr-srvcs-03.txt> Paul Vixie
5 Vixie Enterprises
6 March 1996
7
8 Category: Experimental
9 Updates: RFC 1035, RFC 1183
10
11
12 A DNS RR for specifying the location of services (DNS SRV)
13
14
15 Abstract
16
17 This document describes a DNS RR which specifies the location of the
18 server(s) for a specific protocol and domain (like a more general
19 form of MX).
20
21 Status of this memo
22
23 This document is an Internet-Draft. Internet-Drafts are working
24 documents of the Internet Engineering Task Force (IETF), its areas,
25 and its working groups. Note that other groups may also distribute
26 working documents as Internet-Drafts.
27
28 Internet-Drafts are draft documents valid for a maximum of six months
29 and may be updated, replaced, or obsoleted by other documents at any
30 time. It is inappropriate to use Internet-Drafts as reference
31 material or to cite them other than as ``work in progress.''
32
33 To learn the current status of any Internet-Draft, please check the
34 ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
35 Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
36 munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
37 ftp.isi.edu (US West Coast).
38
39 Overview and rationale
40
41 Currently, one must either know the exact address of a server to
42 contact it, or broadcast a question. This has led to e.g.
43 ftp.whatever.com aliases, the SMTP-specific MX RR, and using MAC-
44 level broadcasts to locate servers.
45
46 The SRV RR allows administrators to use several servers for a single
47 domain, to move services from host to host with little fuss, and to
48 designate some hosts as primary servers for a service and others as
49 backups.
50
51
52
53 Gulbrandsen and Vixie [Page 1]
54 \f
55 Expires October 1996 DNS SRV RR March 1996
56
57
58 Clients ask for a specific service/protocol for a specific domain
59 (the word domain is used here in the strict RFC 1034 sense), and get
60 back the names of any available servers.
61
62
63 Introductory example
64
65 When a SRV-cognizant web-browser wants to retrieve
66
67 http://www.asdf.com/
68
69 it does a lookup of
70
71 _http._tcp.www.asdf.com
72
73 and retrieves the document from one of the servers in the reply. The
74 example zone file near the end of the draft contains answering RRs
75 for this query.
76
77
78 The format of the SRV RR
79
80 Here is the format of the SRV RR, whose DNS type code is 33:
81
82 _Service._Proto.Name TTL Class SRV Priority Weight Port Target
83
84 (There is an example near the end of this document.)
85
86 Service
87 The symbolic name of the desired service, as defined in Assigned
88 Numbers or locally. An underscore (_) is prepended to the
89 service identifier to avoid collisions with DNS labels that
90 occur in nature.
91
92 Some widely used services, notably POP, don't have a single
93 universal name. If Assigned Numbers names the service
94 indicated, that name is the only name which is legal for SRV
95 lookups. Only locally defined services may be named locally.
96 The Service is case insensitive.
97
98 Proto
99 The symbolic name of the desired protocol, with an underscore
100 (_) prepended to prevent collisions with DNS labels that occur
101 in nature. _TCP and _UDP are at present the most useful values
102 for this field, though any name defined by Assigned Numbers or
103 locally may be used (as for Service). The Proto is case
104 insensitive.
105
106
107
108
109 Gulbrandsen and Vixie [Page 2]
110 \f
111 Expires October 1996 DNS SRV RR March 1996
112
113
114 Name
115 The domain this RR refers to. The SRV RR is unique in that the
116 name one searches for is not this name; the example near the end
117 shows this clearly.
118
119 TTL
120 Standard DNS meaning.
121
122 Class
123 Standard DNS meaning.
124
125 Priority
126 As for MX, the priority of this target host. A client MUST
127 attempt to contact the target host with the lowest-numbered
128 priority it can reach; target hosts with the same priority
129 SHOULD be tried in pseudorandom order. The range is 0-65535.
130
131 Weight
132 Load balancing mechanism. When selecting a target host among
133 the those that have the same priority, the chance of trying this
134 one first SHOULD be proportional to its weight. The range of
135 this number is 1-65535. Domain administrators are urged to use
136 Weight 0 when there isn't any load balancing to do, to make the
137 RR easier to read for humans (less noisy).
138
139 Port
140 The port on this target host of this service. The range is
141 0-65535. This is often as specified in Assigned Numbers but
142 need not be.
143
144 Target
145 As for MX, the domain name of the target host. There MUST be
146 one or more A records for this name. Implementors are urged, but
147 not required, to return the A record(s) in the Additional Data
148 section. Name compression is to be used for this field.
149
150 A Target of ``.'' means that the service is decidedly not
151 available at this domain.
152
153
154 Domain administrator advice
155
156 Asking everyone to update their telnet (for example) clients when the
157 first internet site adds a SRV RR for Telnet/TCP is futile (even if
158 desirable). Therefore SRV will have to coexist with A record lookups
159 for a long time, and DNS administrators should try to provide A
160 records to support old clients:
161
162
163
164
165 Gulbrandsen and Vixie [Page 3]
166 \f
167 Expires October 1996 DNS SRV RR March 1996
168
169
170 - Where the services for a single domain are spread over several
171 hosts, it seems advisable to have a list of A RRs at the same
172 DNS node as the SRV RR, listing reasonable (if perhaps
173 suboptimal) fallback hosts for Telnet, NNTP and other protocols
174 likely to be used with this name. Note that some programs only
175 try the first address they get back from e.g. gethostbyname(),
176 and we don't know how widespread this behaviour is.
177
178 - Where one service is provided by several hosts, one can either
179 provide A records for all the hosts (in which case the round-
180 robin mechanism, where available, will share the load equally)
181 or just for one (presumably the fastest).
182
183 - If a host is intended to provide a service only when the main
184 server(s) is/are down, it probably shouldn't be listed in A
185 records.
186
187 - Hosts that are referenced by backup A records must use the port
188 number specified in Assigned Numbers for the service.
189
190 Currently there's a practical limit of 512 bytes for DNS replies.
191 Until all resolvers can handle larger responses, domain
192 administrators are strongly advised to keep their SRV replies below
193 512 bytes.
194
195 All round numbers, wrote Dr. Johnson, are false, and these numbers
196 are very round: A reply packet has a 30-byte overhead plus the name
197 of the service (``_telnet._tcp.asdf.com'' for instance); each SRV RR
198 adds 20 bytes plus the name of the target host; each NS RR in the NS
199 section is 15 bytes plus the name of the name server host; and
200 finally each A RR in the additional data section is 20 bytes or so,
201 and there are A's for each SRV and NS RR mentioned in the answer.
202 This size estimate is extremely crude, but shouldn't underestimate
203 the actual answer size by much. If an answer may be close to the
204 limit, using e.g. ``dig'' to look at the actual answer is a good
205 idea.
206
207
208 The ``Weight'' field
209
210 Weight, the load balancing field, is not quite satisfactory, but the
211 actual load on typical servers changes much too quickly to be kept
212 around in DNS caches. It seems to the authors that offering
213 administrators a way to say ``this machine is three times as fast as
214 that one'' is the best that can practically be done.
215
216
217
218
219
220
221 Gulbrandsen and Vixie [Page 4]
222 \f
223 Expires October 1996 DNS SRV RR March 1996
224
225
226 The only way the authors can see of getting a ``better'' load figure
227 is asking a separate server when the client selects a server and
228 contacts it. For short-lived services like SMTP an extra step in the
229 connection establishment seems too expensive, and for long-lived
230 services like telnet, the load figure may well be thrown off a minute
231 after the connection is established when someone else starts or
232 finishes a heavy job.
233
234
235 The Port number
236
237 Currently, the translation from service name to port number happens
238 at the client, often using a file such as /etc/services.
239
240 Moving this information to the DNS makes it less necessary to update
241 these files on every single computer of the net every time a new
242 service is added, and makes it possible to move standard services out
243 of the ``root-only'' port range on unix.
244
245
246 Usage rules
247
248 A SRV-cognizant client SHOULD use this procedure to locate a list of
249 servers and connect to the preferred one:
250
251 Do a lookup for QNAME=_service._protocol.target, QCLASS=IN,
252 QTYPE=SRV.
253
254 If the reply is NOERROR, ANCOUNT>0 and there is at least one SRV
255 RR which specifies the requested Service and Protocol in the
256 reply:
257
258 If there is precisely one SRV RR, and its Target is ``.''
259 (the root domain), abort.
260
261 Else, for all such RR's, build a list of (Priority, Weight,
262 Target) tuples
263
264 Sort the list by priority (lowest number first)
265
266 Create a new empty list
267
268 For each distinct priority level
269 While there are still elements left at this priority
270 level
271 Select an element randomly, with probability
272 Weight, and move it to the tail of the new list
273
274
275
276
277 Gulbrandsen and Vixie [Page 5]
278 \f
279 Expires October 1996 DNS SRV RR March 1996
280
281
282 For each element in the new list
283
284 query the DNS for A RR's for the Target or use any
285 RR's found in the Additional Data secion of the
286 earlier SRV query.
287
288 for each A RR found, try to connect to the (protocol,
289 address, service).
290
291 else if the service desired is SMTP
292
293 skip to RFC 974 (MX).
294
295 else
296
297 Do a lookup for QNAME=target, QCLASS=IN, QTYPE=A
298
299 for each A RR found, try to connect to the (protocol,
300 address, service)
301
302 Notes:
303
304 - Port numbers SHOULD NOT be used in place of the symbolic service
305 or protocol names (for the same reason why variant names cannot
306 be allowed: Applications would have to do two or more lookups).
307
308 - If a truncated response comes back from an SRV query, and the
309 Additional Data section has at least one complete RR in it, the
310 answer MUST be considered complete and the client resolver
311 SHOULD NOT retry the query using TCP, but use normal UDP queries
312 for A RR's missing from the Additional Data section.
313
314 - A client MAY use means other than Weight to choose among target
315 hosts with equal Priority.
316
317 - A client MUST parse all of the RR's in the reply.
318
319 - If the Additional Data section doesn't contain A RR's for all
320 the SRV RR's and the client may want to connect to the target
321 host(s) involved, the client MUST look up the A RR(s). (This
322 happens quite often when the A RR has shorter TTL than the SRV
323 or NS RR's.)
324
325 - A future standard could specify that a SRV RR whose Protocol was
326 _TCP and whose Service was _SMTP would override RFC 974's rules
327 with regard to the use of an MX RR. This would allow firewalled
328 organizations with several SMTP relays to control the load
329 distribution using the Weight field.
330
331
332
333 Gulbrandsen and Vixie [Page 6]
334 \f
335 Expires October 1996 DNS SRV RR March 1996
336
337
338 - Future protocols could be designed to use SRV RR lookups as the
339 means by which clients locate their servers.
340
341
342 Fictional example
343
344 This is (part of) the zone file for asdf.com, a still-unused domain:
345
346 $ORIGIN asdf.com.
347 @ SOA server.asdf.com. root.asdf.com. (
348 1995032001 3600 3600 604800 86400 )
349 NS server.asdf.com.
350 NS ns1.ip-provider.net.
351 NS ns2.ip-provider.net.
352 _ftp._tcp SRV 0 0 21 server.asdf.com.
353 _finger._tcp SRV 0 0 79 server.asdf.com.
354 ; telnet - use old-slow-box or new-fast-box if either is
355 ; available, make three quarters of the logins go to
356 ; new-fast-box.
357 _telnet._tcp SRV 0 1 23 old-slow-box.asdf.com.
358 SRV 0 3 23 new-fast-box.asdf.com.
359 ; if neither old-slow-box or new-fast-box is up, switch to
360 ; using the sysdmin's box and the server
361 SRV 1 0 23 sysadmins-box.asdf.com.
362 SRV 1 0 23 server.asdf.com.
363 ; HTTP - server is the main server, new-fast-box is the backup
364 ; (On new-fast-box, the HTTP daemon runs on port 8000)
365 _http._tcp SRV 0 0 80 server.asdf.com.
366 SRV 10 0 8000 new-fast-box.asdf.com.
367 ; since we want to support both http://asdf.com/ and
368 ; http://www.asdf.com/ we need the next two RRs as well
369 _http._tcp.www SRV 0 0 80 server.asdf.com.
370 SRV 10 0 8000 new-fast-box.asdf.com.
371 ; SMTP - mail goes to the server, and to the IP provider if
372 ; the net is down
373 _smtp._tcp SRV 0 0 25 server.asdf.com.
374 SRV 1 0 25 mailhost.ip-provider.net.
375 @ MX 0 server.asdf.com.
376 MX 1 mailhost.ip-provider.net.
377 ; NNTP - use the IP providers's NNTP server
378 _nntp._tcp SRV 0 0 119 nntphost.ip-provider.net.
379 ; IDB is an locally defined protocol
380 _idb._tcp SRV 0 0 2025 new-fast-box.asdf.com.
381 ; addresses
382 server A 172.30.79.10
383 old-slow-box A 172.30.79.11
384 sysadmins-box A 172.30.79.12
385 new-fast-box A 172.30.79.13
386
387
388
389 Gulbrandsen and Vixie [Page 7]
390 \f
391 Expires October 1996 DNS SRV RR March 1996
392
393
394 ; backup A records - new-fast-box and old-slow-box are
395 ; included, naturally, and server is too, but might go
396 ; if the load got too bad
397 @ A 172.30.79.10
398 A 172.30.79.11
399 A 172.30.79.13
400 ; backup A RR for www.asdf.com
401 www A 172.30.79.10
402 ; NO other services are supported
403 *._tcp SRV 0 0 0 .
404 *._udp SRV 0 0 0 .
405
406 In this example, a telnet connection to ``asdf.com.'' needs an SRV
407 lookup of ``_telnet._tcp.asdf.com.'' and possibly A lookups of ``new-
408 fast-box.asdf.com.'' and/or the other hosts named. The size of the
409 SRV reply is approximately 365 bytes:
410
411 30 bytes general overhead
412 20 bytes for the query string, ``_telnet._tcp.asdf.com.''
413 130 bytes for 4 SRV RR's, 20 bytes each plus the lengths of ``new-
414 fast-box'', ``old-slow-box'', ``server'' and ``sysadmins-box'' -
415 ``asdf.com'' in the query section is quoted here and doesn't
416 need to be counted again.
417 75 bytes for 3 NS RRs, 15 bytes each plus the lengths of
418 ``server'', ``ns1.ip-provider.net.'' and ``ns2'' - again, ``ip-
419 provider.net.'' is quoted and only needs to be counted once.
420 120 bytes for the 6 A RR's mentioned by the SRV and NS RR's.
421
422
423 Refererences
424
425 RFC 1918: Y. Rekhter, R. Moskowitz, D. Karrenberg, G. de Groot, E.
426 Lear, ``Address Allocation for Private Internets'', 02/29/1996.
427
428 RFC 1916 H. Berkowitz, P. Ferguson, W. Leland, P. Nesser,
429 ``Enterprise Renumbering: Experience and Information
430 Solicitation'', 02/28/1996.
431
432 RFC 1912 D. Barr, ``Common DNS Operational and Configuration
433 Errors'', 02/28/1996.
434
435 RFC 1900: B. Carpenter, Y. Rekhter, ``Renumbering Needs Work'',
436 02/28/1996.
437
438 RFC 1880: J. Postel, ``INTERNET OFFICIAL PROTOCOL STANDARDS'',
439 11/29/1995.
440
441 RFC 1814: E. Gerich, ``Unique Addresses are Good'', 06/22/1995.
442
443
444
445 Gulbrandsen and Vixie [Page 8]
446 \f
447 Expires October 1996 DNS SRV RR March 1996
448
449
450 RFC 1794: T. Brisco, ``DNS Support for Load Balancing'', 04/20/1995.
451
452 RFC 1713: A. Romao, ``Tools for DNS debugging'', 11/03/1994.
453
454 RFC 1712: C. Farrell, M. Schulze, S. Pleitner, D. Baldoni, ``DNS
455 Encoding of Geographical Location'', 11/01/1994.
456
457 RFC 1706: B. Manning, R. Colella, ``DNS NSAP Resource Records'',
458 10/26/1994.
459
460 RFC 1700: J. Reynolds, J. Postel, ``ASSIGNED NUMBERS'', 10/20/1994.
461
462 RFC 1183: R. Ullmann, P. Mockapetris, L. Mamakos, C. Everhart, ``New
463 DNS RR Definitions'', 10/08/1990.
464
465 RFC 1101: P. Mockapetris, ``DNS encoding of network names and other
466 types'', 04/01/1989.
467
468 RFC 1035: P. Mockapetris, ``Domain names - implementation and
469 specification'', 11/01/1987.
470
471 RFC 1034: P. Mockapetris, ``Domain names - concepts and facilities'',
472 11/01/1987.
473
474 RFC 1033: M. Lottor, ``Domain administrators operations guide'',
475 11/01/1987.
476
477 RFC 1032: M. Stahl, ``Domain administrators guide'', 11/01/1987.
478
479 RFC 974: C. Partridge, ``Mail routing and the domain system'',
480 01/01/1986.
481
482
483 Security Considerations
484
485 The authors believes this RR to not cause any new security problems.
486 Some problems become more visible, though.
487
488 - The ability to specify ports on a fine-grained basis obviously
489 changes how a router can filter packets. It becomes impossible
490 to block internal clients from accessing specific external
491 services, slightly harder to block internal users from running
492 unautorised services, and more important for the router
493 operations and DNS operations personnel to cooperate.
494
495 - There is no way a site can keep its hosts from being referenced
496 as servers (as, indeed, some sites become unwilling secondary
497 MXes today). This could lead to denial of service.
498
499
500
501 Gulbrandsen and Vixie [Page 9]
502 \f
503 Expires October 1996 DNS SRV RR March 1996
504
505
506 - With SRV, DNS spoofers can supply false port numbers, as well as
507 host names and addresses. The authors do not see any practical
508 effect of this.
509
510 We assume that as the DNS-security people invent new features, DNS
511 servers will return the relevant RRs in the Additional Data section
512 when answering an SRV query.
513
514
515 Authors' Addresses
516
517 Arnt Gulbrandsen
518 Troll Tech
519 Postboks 6133 Etterstad
520 N-0602 Oslo
521 Norway
522
523 Phone: +47 22646966
524
525 Mail: agulbra@troll.no
526
527 Paul Vixie
528 Vixie Enterprises
529 Star Route 159A
530 Woodside, CA 94062
531
532 Phone: (415) 747-0204
533
534 Mail: paul@vix.com
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557 Gulbrandsen and Vixie [Page 10]
558 \f
559