powered by Jive Software

MiniDns ignore response without the "recursion available" flag set

Hi,

We are using smack for our Android app. We noticed that for some French mobile networks operators, we have a DNS resolution error.

However the query DNS succeed to resolve DNS but the response doesn’t contains RA flags.

Query :

DnsMessage(40048 QUERY NO_ERROR query[qr=0] rd)
[Q: xmpp-02.x. IN A]
[X: EDNS: version: 0, flags:; udp: 1024]

Response :

DnsMessage(40048 QUERY NO_ERROR resp[qr=1] rd)
[Q: xmpp-02.x. IN A]
[A: xmpp-02.x. x IN A x.x.x.x]
[X: EDNS: version: 0, flags:; udp: 4096]

Log:

Could not resolve DNS SRV resource records for _xmpp-client._tcp.x. Consider adding those.
The DNS server /x.x.x.x returned a response without the "recursion available" (RA) flag set. This likely indicates a misconfiguration because the server is not suitable for DNS resolution. 
The DNS server /8.8.8.8 returned a response without the "recursion available" (RA) flag set. This likely indicates a misconfiguration because the server is not suitable for DNS resolution.

DNSClient.java line 155:

                responseMessage = query(q, dns);
                if (responseMessage == null) {
                    continue;
                }

                if (!responseMessage.recursionAvailable) {
                    boolean newRaServer = nonRaServers.add(dns);
                    if (newRaServer) {
                        LOGGER.warning("The DNS server "
                                + dns
                                + " returned a response without the \"recursion available\" (RA) flag set. This likely indicates a misconfiguration because the server is not suitable for DNS resolution");
                    }
                    continue;
                }

Why MiniDns ignore response if recursion isn’t available even though response contains the IP ?

Thanks in advance for your help,

Louis

Smack version : 4.3.4

It is interesting how french mobile network operators often come up regarding non-standard or detrimental behavior, like extremely short NAT timeouts (2-3 minutes).

While we could add an extra check for this, the response is contradictory: The server says it won’t do recursion for you, but then it does. Eventually MiniDNS will use the hardcoded fall back DNS services, so it shouldn’t be a big issue.

I would still suggest to inform the french mobile network operator about their misbehaving DNS server.

Why do you mean with “The server says it won’t do recursion for you, but then it does” - Unless I’m mistaken, the server can resolve the IP without recursion ? If so why exclude it ?

Besides, the hardcoded fall back doesn’t seem to work :

The DNS server /8.8.8.8 returned a response without the "recursion available" (RA) flag set. This likely indicates a misconfiguration because the server is not suitable for DNS resolution
The DNS server /2001:4860:4860::8888 returned a response without the "recursion available" (RA) flag set. This likely indicates a misconfiguration because the server is not suitable for DNS resolution

We can’t connect at all with some french operators :smiley: