Discussion:
[prosody-users] Prosody S2S communication with Zeroconf
Bartłomiej Korpała
2016-01-05 11:13:56 UTC
Permalink
Hello! I have local network without DHCP: 3 computers (2 with Prosody and
Avahi). I can't for example ping computer with XMPP server like "ping
host.local". I can connect by Psi+ with account on computer with Avahi but
when I'm trying to establish subscription between accounts on computers
with Avahi I get information that it can't resolve name like "host.local". Information
is like "Server-to-server connection failed: DNS resolution failed". In
other words how to establish S2S connection between 2 servers using Avahi
("host.local")? Any ideas?
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Thijs Alkemade
2016-01-05 13:55:33 UTC
Permalink
Hello! I have local network without DHCP: 3 computers (2 with Prosody and Avahi). I can't for example ping computer with XMPP server like "ping host.local". I can connect by Psi+ with account on computer with Avahi but when I'm trying to establish subscription between accounts on computers with Avahi I get information that it can't resolve name like "host.local". Information is like "Server-to-server connection failed: DNS resolution failed". In other words how to establish S2S connection between 2 servers using Avahi ("host.local")? Any ideas?
This is somewhat tricky. Prosody's DNS support is mostly custom written (as
there's no good other way to do asynchronous SRV looks in a cross-platform
way). It would be possible to do add support for mDNS, but that would require
either a plugin or modification of Prosody.

If the number of hosts is limited and you can give them a static IP address,
then maybe you can use this module instead:

https://modules.prosody.im/mod_srvinjection.html

Hope this helps,
Thijs
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Bartłomiej Korpała
2016-01-07 10:44:23 UTC
Permalink
srvinjection = {
["*"] = {"host0.local", 5222};

["*"] = {"host0.local", 5269};

};

or maybe
srvinjection = {
["host0.local"] = {"localhost", 5222};

["host0.local"] = {"localhost", 5269};

};

?
I tried both but it doesn't help.

W dniu wtorek, 5 stycznia 2016 14:55:38 UTC+1 uÅŒytkownik Thijs Alkemade
Post by Bartłomiej Korpała
Hello! I have local network without DHCP: 3 computers (2 with Prosody
and Avahi). I can't for example ping computer with XMPP server like "ping
host.local". I can connect by Psi+ with account on computer with Avahi but
when I'm trying to establish subscription between accounts on computers
with Avahi I get information that it can't resolve name like "host.local".
Information is like "Server-to-server connection failed: DNS resolution
failed". In other words how to establish S2S connection between 2 servers
using Avahi ("host.local")? Any ideas?
This is somewhat tricky. Prosody's DNS support is mostly custom written (as
there's no good other way to do asynchronous SRV looks in a cross-platform
way). It would be possible to do add support for mDNS, but that would require
either a plugin or modification of Prosody.
If the number of hosts is limited and you can give them a static IP address,
https://modules.prosody.im/mod_srvinjection.html
Hope this helps,
Thijs
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Thijs Alkemade
2016-01-07 13:42:58 UTC
Permalink
srvinjection = {
["*"] = {"host0.local", 5222};
["*"] = {"host0.local", 5269};
};
or maybe
srvinjection = {
["host0.local"] = {"localhost", 5222};
["host0.local"] = {"localhost", 5269};
};
Both look wrong, you don’t need a record for port 5222, as that’s only for
client to server connections. Correct syntax would be:

srvinjection = {
["host0.local"] = {"localhost", 5269};
};

Hope this helps,
Thijs
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Bartłomiej Korpała
2016-01-08 08:55:24 UTC
Permalink
It didn't help. :/

W dniu czwartek, 7 stycznia 2016 14:43:05 UTC+1 uÅŒytkownik Thijs Alkemade
Post by Thijs Alkemade
srvinjection = {
["*"] = {"host0.local", 5222};
["*"] = {"host0.local", 5269};
};
or maybe
srvinjection = {
["host0.local"] = {"localhost", 5222};
["host0.local"] = {"localhost", 5269};
};
Both look wrong, you don’t need a record for port 5222, as that’s only for
srvinjection = {
["host0.local"] = {"localhost", 5269};
};
Hope this helps,
Thijs
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Thijs Alkemade
2016-01-08 17:55:28 UTC
Permalink
Post by Bartłomiej Korpała
It didn't help. :/
Please post debug logs from a connection attempt.
Post by Bartłomiej Korpała
srvinjection = {
["*"] = {"host0.local", 5222};
["*"] = {"host0.local", 5269};
};
or maybe
srvinjection = {
["host0.local"] = {"localhost", 5222};
["host0.local"] = {"localhost", 5269};
};
Both look wrong, you don’t need a record for port 5222, as that’s only for
srvinjection = {
["host0.local"] = {"localhost", 5269};
};
Hope this helps,
Thijs
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Bartłomiej Korpała
2016-01-11 07:44:02 UTC
Permalink
<error type="cancel">
<remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Server-to-server
connection failed: DNS resolution failed</text>
</error>
</presence>
<error type="cancel">
<remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Server-to-server
connection failed: DNS resolution failed</text>
</error>
</presence>
Jan 11 08:37:33 c2s888cbb8 info Client connected
Jan 11 08:37:33 c2s888cbb8 info Authenticated as
Jan 11 08:38:03 s2sout8884e48 info Out of connection options, can't
connect to vertex1.local
Jan 11 08:38:03 s2sout8884e48 info sending error replies for 1 queued
stanzas because of failed outgoing connection to vertex1.local
Jan 11 08:39:34 s2sout87f32d8 info Out of connection options, can't
connect to vertex1.local
Jan 11 08:39:34 s2sout87f32d8 info sending error replies for 2 queued
stanzas because of failed outgoing connection to vertex1.local
W dniu piątek, 8 stycznia 2016 18:55:34 UTC+1 uÅŒytkownik Thijs Alkemade
Post by Bartłomiej Korpała
It didn't help. :/
Please post debug logs from a connection attempt.
Post by Bartłomiej Korpała
W dniu czwartek, 7 stycznia 2016 14:43:05 UTC+1 uÅŒytkownik Thijs
srvinjection = {
["*"] = {"host0.local", 5222};
["*"] = {"host0.local", 5269};
};
or maybe
srvinjection = {
["host0.local"] = {"localhost", 5222};
["host0.local"] = {"localhost", 5269};
};
Both look wrong, you don’t need a record for port 5222, as that’s only
for
Post by Bartłomiej Korpała
srvinjection = {
["host0.local"] = {"localhost", 5269};
};
Hope this helps,
Thijs
--
You received this message because you are subscribed to the Google
Groups "Prosody IM Users" group.
Post by Bartłomiej Korpała
To unsubscribe from this group and stop receiving emails from it, send
<javascript:>.
Post by Bartłomiej Korpała
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Thijs Alkemade
2016-01-11 10:20:07 UTC
Permalink
<error type="cancel">
<remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Server-to-server connection failed: DNS resolution failed</text>
</error>
</presence>
<error type="cancel">
<remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Server-to-server connection failed: DNS resolution failed</text>
</error>
</presence>
Jan 11 08:37:33 c2s888cbb8 info Client connected
Jan 11 08:38:03 s2sout8884e48 info Out of connection options, can't connect to vertex1.local
Jan 11 08:38:03 s2sout8884e48 info sending error replies for 1 queued stanzas because of failed outgoing connection to vertex1.local
Jan 11 08:39:34 s2sout87f32d8 info Out of connection options, can't connect to vertex1.local
Jan 11 08:39:34 s2sout87f32d8 info sending error replies for 2 queued stanzas because of failed outgoing connection to vertex1.local
Please set the log level to “debug” first and then try again.

Regards,
Thijs
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Bartłomiej Korpała
2016-01-11 11:28:50 UTC
Permalink
Jan 11 12:22:39 c2s9430b38 debug Received[c2s]: <presence
Jan 11 12:22:39 bprxubuntu1.local:presence debug outbound presence
Jan 11 12:22:39 stanzarouter debug Routing to remote...
Jan 11 12:22:39 mod_s2s debug opening a new outgoing connection for this
stanza
Jan 11 12:22:39 mod_s2s debug stanza [presence] queued until connection
complete
Jan 11 12:22:39 mod_s2s debug First attempt to connect to vertex1.local,
starting with SRV lookup...
Jan 11 12:22:39 adns debug Records for _xmpp-server._tcp.vertex1.local.
not in cache, sending query (thread: 0x9369690)...
Jan 11 12:22:39 adns debug Sending DNS query to 127.0.0.1
Jan 11 12:22:39 stanzarouter debug Routing to remote...
Jan 11 12:22:39 s2sout9419710 debug trying to send over unauthed s2sout
to vertex1.local
Jan 11 12:22:39 s2sout9419710 debug stanza [presence] queued
Jan 11 12:22:39 bprxubuntu1.local:presence debug broadcasted presence of
Jan 11 12:22:39 socket debug server.lua: client dns:clientport read
error: connection refused
connection refused
Jan 11 12:22:39 adns error Exhausted all 1 configured DNS servers, next
lookup will try 127.0.0.1 again
Jan 11 12:22:39 socket debug server.lua: closed client handler and
removed socket from list
Jan 11 12:22:54 adns debug Reply for _xmpp-server._tcp.vertex1.local.
(thread: 0x9369690)
Jan 11 12:22:54 mod_s2s debug vertex1.local has no SRV records, falling
back to A/AAAA
Jan 11 12:22:54 adns debug Records for vertex1.local not in cache,
sending query (thread: 0x9453940)...
Jan 11 12:22:54 adns debug Sending DNS query to 127.0.0.1
Jan 11 12:22:54 adns debug Records for vertex1.local not in cache,
sending query (thread: 0x943c820)...
Jan 11 12:22:54 adns debug Sending DNS query to 127.0.0.1
Jan 11 12:23:09 adns debug Reply for vertex1.local (thread: 0x9453940)
Jan 11 12:23:09 adns debug Reply for vertex1.local (thread: 0x943c820)
Jan 11 12:23:09 mod_s2s debug DNS lookup failed to get a response for
vertex1.local
Jan 11 12:23:09 s2sout9419710 info Out of connection options, can't
connect to vertex1.local
Jan 11 12:23:09 mod_s2s debug No other records to try for vertex1.local -
destroying
Jan 11 12:23:09 s2sout9419710 debug Destroying outgoing session
bprxubuntu1.local->vertex1.local: DNS resolution failed
Jan 11 12:23:09 s2sout9419710 info sending error replies for 2 queued
stanzas because of failed outgoing connection to vertex1.local
Jan 11 12:23:09 stanzarouter debug Received[s2sin]: <presence
Jan 11 12:23:09 stanzarouter debug Received[s2sin]: <presence
I installed also dnsmasq and added line
"srv-host=_xmpp-server._tcp.localhost,vertex1.local,5269" but was only
difference that faster I did receive the response.

W dniu poniedziałek, 11 stycznia 2016 11:20:12 UTC+1 uÅŒytkownik Thijs
<error type="cancel">
<remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Server-to-server
connection failed: DNS resolution failed</text>
</error>
</presence>
<error type="cancel">
<remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Server-to-server
connection failed: DNS resolution failed</text>
</error>
</presence>
Jan 11 08:37:33 c2s888cbb8 info Client connected
Jan 11 08:37:33 c2s888cbb8 info Authenticated as
Jan 11 08:38:03 s2sout8884e48 info Out of connection
options, can't connect to vertex1.local
Jan 11 08:38:03 s2sout8884e48 info sending error replies
for 1 queued stanzas because of failed outgoing connection to vertex1.local
Jan 11 08:39:34 s2sout87f32d8 info Out of connection
options, can't connect to vertex1.local
Jan 11 08:39:34 s2sout87f32d8 info sending error replies
for 2 queued stanzas because of failed outgoing connection to vertex1.local
Please set the log level to “debug” first and then try again.
Regards,
Thijs
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Bartłomiej Korpała
2016-01-12 14:16:02 UTC
Permalink
Right now I have dnsmasq on two hosts with following records:
srv-host=_xmpp-server._tcp.host1.local,localhost,5269
srv-host=_xmpp-server._tcp.host2.local,host2.local,5269
and
srv-host=_xmpp-server._tcp.host2.local,localhost,5269
srv-host=_xmpp-server._tcp.host1.local,host1.local,5269
When I ask for subscription I get:
Jan 12 15:09:44 c2s9aea8a0 debug Received[c2s]: <presence to=
'***@vertex1.local' type='subscribed'>
Jan 12 15:09:44 bprxubuntu1.local:presence debug outbound presence
subscribed from ***@bprxubuntu1.local for ***@vertex1.local
Jan 12 15:09:44 rostermanager debug load_roster: asked for:
***@bprxubuntu1.local
Jan 12 15:09:44 stanzarouter debug Routing to remote...
Jan 12 15:09:44 mod_s2s debug opening a new outgoing connection for this
stanza
Jan 12 15:09:44 mod_s2s debug stanza [presence] queued until connection
complete
Jan 12 15:09:44 mod_s2s debug First attempt to connect to vertex1.local,
starting with SRV lookup...
Jan 12 15:09:44 adns debug Records for _xmpp-server._tcp.vertex1.local. not
in cache, sending query (thread: 0x9bf9758)...
Jan 12 15:09:44 adns debug Sending DNS query to 127.0.0.1
Jan 12 15:09:44 stanzarouter debug Routing to remote...
Jan 12 15:09:44 s2sout9bf8cd8 debug trying to send over unauthed s2sout to
vertex1.local
Jan 12 15:09:44 s2sout9bf8cd8 debug stanza [presence] queued
Jan 12 15:09:44 bprxubuntu1.local:presence debug broadcasted presence of 1
resources from ***@bprxubuntu1.local to ***@vertex1.local
Jan 12 15:09:44 socket debug server.lua: closed client handler and removed
socket from list
Jan 12 15:09:44 adns debug Reply for _xmpp-server._tcp.vertex1.local. (
thread: 0x9bf9758)
Jan 12 15:09:44 mod_s2s debug vertex1.local has SRV records, handling...
Jan 12 15:09:44 mod_s2s debug Best record found, will connect to vertex1.
local.:5269
Jan 12 15:09:44 adns debug Records for vertex1.local. not in cache, sending
query (thread: 0x9bfd088)...
Jan 12 15:09:44 adns debug Sending DNS query to 127.0.0.1
Jan 12 15:09:44 adns debug Records for vertex1.local. not in cache, sending
query (thread: 0x9bff2d0)...
Jan 12 15:09:44 adns debug Sending DNS query to 127.0.0.1
Jan 12 15:09:44 adns debug Reply for vertex1.local. (thread: 0x9bfd088)
Jan 12 15:09:44 socket debug server.lua: closed client handler and removed
socket from list
Jan 12 15:09:44 adns debug Reply for vertex1.local. (thread: 0x9bff2d0)
Jan 12 15:09:44 mod_s2s debug DNS lookup failed to get a response for
vertex1.local.
Jan 12 15:09:44 s2sout9bf8cd8 info Out of connection options, can't connect
to vertex1.local
Jan 12 15:09:44 mod_s2s debug No other records to try for vertex1.local -
destroying
Jan 12 15:09:44 s2sout9bf8cd8 debug Destroying outgoing session
bprxubuntu1.local->vertex1.local: DNS resolution failed
Jan 12 15:09:44 s2sout9bf8cd8 info sending error replies for 2 queued
stanzas because of failed outgoing connection to vertex1.local
Jan 12 15:09:44 stanzarouter debug Received[s2sin]: <presence type='error'
to='***@bprxubuntu1.local' from='***@vertex1.local'>
Jan 12 15:09:44 stanzarouter debug Received[s2sin]: <presence type='error'
to='***@bprxubuntu1.local/Psi+' from='***@vertex1.local'>
and there is no error about no SRV record.
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Bartłomiej Korpała
2016-01-14 07:18:14 UTC
Permalink
I've found a solution: I had to add to "/etc/dnsmasq.conf" line like
"srv-host=_xmpp-server._tcp.remote_host.local,IP_address,5269".
--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prosody-users+***@googlegroups.com.
To post to this group, send an email to prosody-***@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-users.
For more options, visit https://groups.google.com/d/optout.
Loading...