Guido,
This looks like a problem with your system, not your jabber setup. What
happens is simple, udns is trying to resolve the hostnames but this
takes too long. From the jabberd2 source code I can see that the timeout
is set to 5 seconds.
The fact you didnt see it with jabberd 1.4 is most likely that it does
not have a timeout and will wait "forever".
My suspicion is that there is a problem with a name server you are
using. if you look at the file /etc/resolv.conf you will see one or more
lines saying "nameserver <ip_addr>". The resolver will ask each name
server in turn to resolve the host name for it, switching to the next
one if it does not respond. My guess is that the first name server in
your list does not respond or does not respond in time and the timeout
occurs. There are several things you can try:
First, check if the resolve really takes so long. Do the dig command
again but add "time" in front of it:
prompt$ time dig -t any _xmpp-server._tcp.jabber.org
This works on unix-like operating systems only I think.
In my case (I run a name server locally) it responded with:
eric@polaris:~$ dig -t any _xmpp-server._tcp.jabber.org
; <<>> DiG 9.8.1-P1 <<>> -t any _xmpp-server._tcp.jabber.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46367
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 5, ADDITIONAL: 0
[......]
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Dec 28 08:11:52 2013
;; MSG SIZE rcvd: 225
real 0m0.007s
user 0m0.000s
sys 0m0.004s
As you can see it took 7 millisec, well within the timeout. If you see
times of several seconds or more you have found your problem. Also try
other sites like dig jabber.ccc.de etc.
If this is the problem, here are some ideas on how to fix:
Use a different nameserver as first in /etc/resolve.conf. If you do not
have another nameserver try "nameserver 8.8.8.8" instead (Google's
public name server)
Set up your own name service (actually not that hard to do) and set the
first nameserver line to "nameserver 127.0.0.1". This will usually give
the best results (as long as the name server is configured correctly)
If you cannot improve your nameserver you can try to increase the
timeout. For that you need to edit the file s2s/main.c. Somewhere there
is a line saying something like:
mio_run(s2s->mio, dns_timeouts(0, 5, time(NULL)));
The 5 is the number of seconds the resolver will wait... Increase it and
see what happens.
Of course fixing the resolver is better, long waits for a resolver will
be noticed by your users.
Regards,
Eric.
On 12/27/2013 10:41 PM, Guido Winkelmann wrote:
Hi,
I've recently switched from jabberd14 (yeah, I know...) to jabberd2, and I'm
having trouble with s2s timing out a lot on trying to resolve the names of
other Jabber servers from contacts on my roster. I'm getting a lot of lines
like these in /var/log/messages:
Dec 27 22:15:21 blish jabberd/s2s[20464]: dns lookup for jabber.ccc.de timed
out
Dec 27 22:15:22 blish jabberd/s2s[20464]: dns lookup for freistaat-linden.de
timed out
Dec 27 22:15:22 blish jabberd/s2s[20464]: dns lookup for arara.de timed out
Dec 27 22:15:22 blish jabberd/s2s[20464]: dns lookup for jabber.org timed out
Sometimes, but rarely, the lookup for a server works and I can see the online
status of a contact or two, but most of the time, most of my roster is crossed
out as unreachable.
Manual lookup of these names with, for example
dig -t any _xmpp-server._tcp.jabber.org
works with no problems.
I'm using jabberd2 2.3.1 on Gentoo, installed from portage, and udns 0.2, both
compiled with GCC 4.7.3. The problem also exists with udns 0.1 and GCC 4.5.4,
though.
Does anyone have any idea what might be the problem here?
Guido