-
Notifications
You must be signed in to change notification settings - Fork 18
/
dns.xml
219 lines (196 loc) · 8.03 KB
/
dns.xml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?xml version="1.0" encoding="UTF-8"?>
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
xml:id="dns">
<title>DNS setup</title>
<para>The DNS records to be created are detailed in
<xref linkend="dns-records-for-example"/></para>
<table xml:id="dns-records-for-example">
<title>DNS records for the example</title>
<tgroup cols="3">
<colspec colname="c1" colnum="1" colwidth="2*" />
<colspec colname="c2" colnum="2" colwidth="1*" />
<colspec colname="c3" colnum="3" colwidth="3*" />
<thead>
<row>
<entry align="center">Record Name</entry>
<entry align="center">Type</entry>
<entry align="center">Value</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>server1</literal></entry>
<entry><literal>A</literal></entry>
<entry><literal>198.51.100.19</literal></entry>
</row>
<row>
<entry><literal>server1</literal></entry>
<entry><literal>AAAA</literal></entry>
<entry><literal>2001:DB8:1000:2000::19</literal></entry>
</row>
<row>
<entry><literal>turn-server</literal></entry>
<entry><literal>A</literal></entry>
<entry><literal>198.51.100.19</literal></entry>
</row>
<row>
<entry><literal>turn-server</literal></entry>
<entry><literal>AAAA</literal></entry>
<entry><literal>2001:DB8:1000:2000::19</literal></entry>
</row>
<row>
<entry><literal>sip-proxy</literal></entry>
<entry><literal>A</literal></entry>
<entry><literal>198.51.100.19</literal></entry>
</row>
<row>
<entry><literal>sip-proxy</literal></entry>
<entry><literal>AAAA</literal></entry>
<entry><literal>2001:DB8:1000:2000::19</literal></entry>
</row>
<row>
<entry><literal>xmpp-gw</literal></entry>
<entry><literal>A</literal></entry>
<entry><literal>198.51.100.19</literal></entry>
</row>
<row>
<entry><literal>xmpp-gw</literal></entry>
<entry><literal>AAAA</literal></entry>
<entry><literal>2001:DB8:1000:2000::19</literal></entry>
</row>
<row>
<entry><literal>_stun._udp</literal></entry>
<entry><literal>SRV</literal></entry>
<entry><literal>0 1 3478 turn-server.example.org.</literal></entry>
</row>
<row>
<entry><literal>_turn._udp</literal></entry>
<entry><literal>SRV</literal></entry>
<entry><literal>0 1 3478 turn-server.example.org.</literal></entry>
</row>
<row>
<entry><literal>_sips._tcp</literal></entry>
<entry><literal>SRV</literal></entry>
<entry><literal>0 1 5061 sip-proxy.example.org.</literal></entry>
</row>
<row>
<entry><literal>_xmpp-client._tcp</literal></entry>
<entry><literal>SRV</literal></entry>
<entry><literal>5 0 5222 xmpp-gw.example.org.</literal></entry>
</row>
<row>
<entry><literal>_xmpp-server._tcp</literal></entry>
<entry><literal>SRV</literal></entry>
<entry><literal>5 0 5269 xmpp-gw.example.org.</literal></entry>
</row>
<row>
<entry><literal>@</literal></entry>
<entry><literal>NAPTR</literal></entry>
<entry><literal>10 0 "s" "SIPS+D2T" "" _sips._tcp.example.org.</literal></entry>
</row>
<row>
<entry><literal>@</literal></entry>
<entry><literal>NAPTR</literal></entry>
<entry><literal>10 0 "s" RELAY:turn.udp "" _turn._udp.example.org.</literal></entry>
</row>
</tbody>
</tgroup>
</table>
<sect1 xml:id="dns-non-standard-ports">
<title>Using non-standard ports</title>
<para>RTC makes use of DNS SRV records for load-balancing and failover.
A key feature of the SRV record is that the TCP or UDP port number is
specified in the record. <xref linkend="dns-records-for-example"/>
demonstrates the use of standard port numbers for SIP, TURN and
XMPP.</para>
<para>If users are connecting to the service from arbitrary locations,
including public wi-fi hotspots, hotels and the offices of other companies,
they will almost certainly encounter firewalls that only allow traffic
to pass on a limited range of port numbers or through HTTP proxy
servers.</para>
<para>For this reason, it is common to operate RTC services on port
443 instead of the normal port numbers. Two or more processes can't
listen on the same port number on the same IP address. When all the
RTC processes have to use port 443, it is necessary to have a different
IP address for each process.
<xref linkend="dns-non-standard-ports-example"/> gives a summary of
the ports to change.</para>
<table xml:id="dns-non-standard-ports-example">
<title>Protocols using port 443</title>
<tgroup cols="3">
<colspec colname="c1" colnum="1" colwidth="2*" />
<colspec colname="c2" colnum="2" colwidth="1*" />
<colspec colname="c3" colnum="3" colwidth="1*" />
<thead>
<row>
<entry align="center">Protocol</entry>
<entry align="center">Default port</entry>
<entry align="center">Non-standard port</entry>
</row>
</thead>
<tbody>
<row>
<entry>STUN / TURN over TLS</entry>
<entry>5349</entry>
<entry>443</entry>
</row>
<row>
<entry>SIP over TLS</entry>
<entry>5061</entry>
<entry>443</entry>
</row>
<row>
<entry>XMPP client</entry>
<entry>5222</entry>
<entry>443</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1>
<sect1 xml:id="dns-sample-zone">
<title>Sample DNS zone file</title>
<para>See <xref linkend="dns-bind-example-zone"/> for an example of
how to write the entries for the zone file. For the purposes of the
example, this file would be <code>/etc/bind/db.example.org</code> on
the nameserver host.</para>
<example xml:id="dns-bind-example-zone">
<title>ISC Bind zone file entries</title>
<programlisting format="linespecific">; the server where everything will run
server1 IN A 198.51.100.19
server1 IN AAAA 2001:DB8:1000:2000::19
; Use different names for each service.
; Don't use CNAMEs, the SRV records (further down)
; can't point to CNAME records.
turn-server IN A 198.51.100.19
turn-server IN AAAA 2001:DB8:1000:2000::19
sip-proxy IN A 198.51.100.19
sip-proxy IN AAAA 2001:DB8:1000:2000::19
xmpp-gw IN A 198.51.100.19
xmpp-gw IN AAAA 2001:DB8:1000:2000::19
; DNS SRV for STUN / TURN
_stun._udp IN SRV 0 1 3478 turn-server.example.org.
_turn._udp IN SRV 0 1 3478 turn-server.example.org.
; DNS SRV and NAPTR records for SIP
_sips._tcp IN SRV 0 1 5061 sip-proxy.example.org.
@ IN NAPTR 10 0 "s" "SIPS+D2T" "" _sips._tcp.example.org.
@ IN NAPTR 10 0 "s" RELAY:turn.udp "" _turn._udp.example.org.
; DNS SRV records for XMPP Server and Client modes:
_xmpp-client._tcp IN SRV 5 0 5222 xmpp-gw.example.org.
_xmpp-server._tcp IN SRV 5 0 5269 xmpp-gw.example.org.</programlisting>
</example>
</sect1>
<sect1 xml:id="dns-testing">
<title>Testing the DNS settings</title>
<para>Use the <code>dig</code> command to test, as demonstrated in
<xref linkend="dns-dig-example"/></para>
<example xml:id="dns-dig-example">
<title>Inspecting DNS entries with <code>dig</code></title>
<programlisting format="linespecific">$ dig -t naptr +short example.org
10 0 "s" "SIPS+D2T" "" _sips._tcp.example.org.
$ dig -t srv +short _sips._tcp.example.org.
0 1 5061 sip-proxy.example.org.</programlisting>
</example>
</sect1>
</chapter>