Understanding DNS and XMPP

SRV Records

SRV records allow clients to automatically determine what resources to connect to for a domain. If you were to configure an XMPP client to use the JID jimjimmers@fwwd.chatwith.it, the client would almost certainly lookup the xmpp-client SRV record for the domain and connect to the appropriate server using the information returned.

An example:

;_xmpp-client._tcp.fwwd.chatwith.it. IN     SRV

_xmpp-client._tcp.fwwd.chatwith.it. 1800 IN SRV     20 10 5222 cd-11-a.srv.chatmongers.net.
_xmpp-client._tcp.fwwd.chatwith.it. 1800 IN SRV     20 10 5222 cd-11-b.srv.chatmongers.net.
_xmpp-client._tcp.fwwd.chatwith.it. 1800 IN SRV     20 10 5222 cd-11-c.srv.chatmongers.net.

Domainpart A Records

If a domain does not maintain SRV records or a client does not support the usage of SRV records for resource resolution, typically the domain portion of the JID will be used to determine the server.

This is the same domain, but instead we have asked for the domain’s A record:

;fwwd.chatwith.it.              IN      A

fwwd.chatwith.it.       1800    IN      CNAME   cd-11.srv.chatmongers.net.
cd-11.srv.chatmongers.net. 1800 IN      A

Explicitly Specifying a Server

Most XMPP clients and libraries will allow you to explicity specify a server, rather than leave it up to the client to determine.