S2s does not work on debian xmpp server. I can not understand what was the matter, I tried prosody - nothing happened, now ejabberd, the same problem. Locally, everything works on the domain, but adding contacts from other servers does not authorize. Work certificate from letsencrypt. There are two SRV records in the DNS records:

_xmpp-server._tcp.mydomain.ru. 86400 IN SRV 5 0 5269 mydomain.ru. _xmpp-client._tcp.mydomain.ru. 86400 IN SRV 5 0 5222 mydomain.ru. 

They are successfully displayed by the https://kingant.net/check_xmpp_dns service. In ejabberd logs, this is what:

 2016-09-18 09:03:52.542 [info] <0.445.0>@ejabberd_s2s:new_connection:456 New s2s connection started <0.474.0> 2016-09-18 09:03:52.595 [info] <0.474.0>@ejabberd_s2s_out:log_s2s_out:1315 Trying to open s2s connection: mydomain.ru -> gmail.com with TLS=true 2016-09-18 09:04:11.414 [error] <0.474.0>@ejabberd_s2s_out:srv_lookup:1215 The DNS servers [{{127,0,0,1},53},{{46,28,201,21},53},{{46,28,201,22},53}] timed out on request for "gmail.com" IN SRV. You should check your DNS configuration. 2016-09-18 09:04:50.198 [info] <0.474.0>@ejabberd_s2s_out:open_socket:271 s2s connection: mydomain.ru -> gmail.com (remote server not found) 2016-09-18 09:04:55.180 [info] <0.474.0>@ejabberd_s2s_out:handle_info:990 Reconnect delay expired: Will now retry to connect to gmail.com when needed. 

This is an example of connecting to an xmpp account on gmail.com, with other servers the same.

With prosody it was similar. As for the DNS - it seems that all the necessary records are made. Tell me, please, what could be the matter.

    1 answer 1

    After talking with the tech support of the company providing the VPS, a random solution was found: the content and order of the entries in /etc/resolv.conf critical for xmpp servers. It was:

     nameserver 127.0.0.1 nameserver 1.2.3.4 nameserver 1.2.3.5 

    (where 1.2.3.4 and 1.2.3.5 are the ip addresses of the dns servers) Changed to:

     nameserver 1.2.3.4 nameserver 1.2.3.5 nameserver 127.0.0.1 

    And ejabberd immediately began to log in successfully with other servers:

     2016-09-18 15:16:08.784 [info] <0.455.0>@ejabberd_s2s:new_connection:456 New s2s connection started <0.462.0> 2016-09-18 15:16:08.785 [info] <0.462.0>@ejabberd_s2s_out:log_s2s_out:1315 Trying to open s2s connection: myserver.ru -> gmail.com with TLS=true 2016-09-18 15:16:09.516 [info] <0.449.0>@ejabberd_listener:accept:313 (#Port<0.6902>) Accepted connection ::FFFF:74.125.113.32:53716 -> ::FFFF:1.2.3.6:5269 2016-09-18 15:16:09.775 [info] <0.462.0>@ejabberd_s2s_out:wait_for_validation:434 Connection established: myserver.ru -> gmail.com with TLS=false 2016-09-18 15:16:30.178 [info] <0.472.0>@ejabberd_s2s_out:wait_for_validation:510 wait for validation: myserver.ru -> gmail.com (closed)