SRV-DNS Problem / Cannot build up a s2s to some servers

Symptomes

If your ejabberd can connect to some server and some not, then you maybe have a dns resolution problem. That means you can lookup DNS A Entries but not DNS SRV entries.

The problem is that a jabber server sometimes has a different ip-adress than all the other server on that domain. For this cases SRV Entries give back the correct ip-adress for the jabber-server.

ejabberd 1.1.4

Unfortunately ejabbberd 1.1.4 does not offer different loglevels. But if you recognize that s2s-connections terminate at the point to begin with starttls, then you should check your log entries for outgoing messages to these servers.

=INFO REPORT==== 2008-04-11 14:09:14 ===
I(<0.1389.0>:ejabberd_s2s_out:106): started: {"mydomain.com,"destination.com",
                                              {new,"2966681719"}}

=INFO REPORT==== 2008-04-11 14:09:14 ===
I(<0.1389.0>:ejabberd_s2s_out:662): terminated: normal

ejabberd 2.0.0

Ejabberd 2.0.0 offers loglevels now. So if you set your loglevel to 5 and you get log entries like:

=INFO REPORT==== 2008-04-12 00:21:08 ===
D(<0.351.0>:ejabberd_s2s_out:925) : srv lookup of 'destination.com' failed: timeout

=INFO REPORT==== 2008-04-12 00:21:08 ===
D(<0.351.0>:ejabberd_s2s_out:236) : s2s_out: connecting to destination.com:5269

=INFO REPORT==== 2008-04-12 00:21:08 ===
D(<0.351.0>:ejabberd_s2s_out:243) : s2s_out: connect return ehostunreach

=INFO REPORT==== 2008-04-12 00:21:08 ===
D(<0.351.0>:ejabberd_s2s_out:259) : s2s_out: inet6 connect return nxdomain

=INFO REPORT==== 2008-04-12 00:21:08 ===
I(<0.351.0>:ejabberd_s2s_out:218) : s2s connection: mydomain.com -> destination.com (remote server not found)

then you maybe have a dns-resolution problem.

Solution

EJabberd first tries to make a srv-dns lookup. If this fails, ejabberd will make a normal dns lookup.

Write the /etc/resolv.conf in a proper way. You can test it with e.g. dig from bind-tools.

Try to get a correct dns answer with e.g.:

dig gmail.com

or

dig _xmpp-server._tcp.gmail.com srv

A simple but correct resolv.conf can look like:

nameserver <ip>

Just to be sure that your firewall does not block your s2s port check if e.g.

telnet xmpp-server1.l.google.com 5269

works without error messages.

Do not forget to restart your ejabberd to make changes in resolv.conf also affects ejabberd.

Related Links

Syndicate content