DNS – How to Redirect XMPP with DNS

dns-serverdomain-name-systemxmpp

Is it possible to redirect XMPP using DNS records?

I have a domain hosted on a shared host that does not have Jabber support. If possible, I'd like to still have XMPP on this domain, but have it connect to another IP (configured to support the first domain) without user intervention. I'm using ejabberd on the second server, if that helps.

Best Answer

You need SRV records, e.g.

_jabber._tcp.example.com.       IN SRV   0 0 5269   xmpp.example.com.
_xmpp-server._tcp.example.com.  IN SRV   0 0 5269   xmpp.example.com.
_xmpp-client._tcp.example.com.  IN SRV   0 0 5222   xmpp.example.com.

(Adjust the port numbers and domain names to suit).

XMPP clients should automatically look these up, and if found connect to the specified host name instead of whatever host the main domain itself resolves to.