Configuring DNS for XMPP
Much like an e-mail server, there are special DNS records which you can optionally add to your zone file in order to change how the XMPP service operates.
How to do it…
- Add the c2s service to DNS:
_xmpp-client._tcp 28800 IN SRV 20 0 5222 xmpp.example.com.
- Add the s2s service to DNS:
_xmpp-server._tcp 28800 IN SRV 20 0 5269 xmpp.example.com.
How it works…
Similar to an e-mail, XMPP can use normal A records (or CNAMEs) for a given domain to handle message delivery if the messages are going to be defined to the IP for the root of the domain. In other words, if user@example.com
will be hosted on a server which example.com points to directly, then it will work fine.
Also similar to an e-mail, it often makes sense to have the traffic served by a different machine. Rather than MX records which are mail-specific, XMPP uses SRV records, which are a more general approach to looking up a service.
The SRV records are in the format of:
- Service: The predefined service name...