MiniDNS / minidns

DNS library for Android and Java SE
Other
220 stars 61 forks source link

IDN problems when feeding DnsName from SRV record into resolver again #63

Closed iNPUTmice closed 7 years ago

iNPUTmice commented 7 years ago

When the hostname of a SRV records contains a punycode domain I'm unable to feed the same DnsName object into the resolver again. Meaning ResolverApi.INSTANCE.resolve(srv.name,A.class) doesn't work. But ResolverApi.INSTANCE.resolve(DnsName.from(srv.name.toString()) does. I'm currently unsure if the request is wrong or if getAnswersForQuestion() leads to an empty result.

Steps to reproduce 1) Resolve SRV xmpp-client._tcp.im.plä.net 2) loop over the results 3) resolve A record for each srv.name 4) see empty results 5) resolve A record for each DnsName.from(srv.name.toString()) 6) see results.

Flowdalic commented 7 years ago

Thanks for reporting. I reproduced that behavior using the master branch via

./repl
…
@ r resolve ("_xmpp-client._tcp.im.plä.net", classOf[SRV]) 
res0: hla.ResolverResult[SRV] = de.measite.minidns.hla.ResolverResult
Question: _xmpp-client._tcp.im.xn--pl-wia.net.  IN  SRV
Response Code: NO_ERROR
[_xmpp-client._tcp.im.xn--pl-wia.net.   85928   IN  SRV 5 0 5222 im.plä.net.]
@ res0.getAnswers().iterator().next() 
res1: SRV = 5 0 5222 im.plä.net.
@ r resolve (res1.name, classOf[A]) 
res2: hla.ResolverResult[A] = de.measite.minidns.hla.ResolverResult
Question: im.plä.net.   IN  A
Response Code: NX_DOMAIN

@ r resolve ("im.plä.net", classOf[A]) 
res3: hla.ResolverResult[A] = de.measite.minidns.hla.ResolverResult
Question: im.xn--pl-wia.net.    IN  A
Response Code: NO_ERROR
[im.xn--pl-wia.net. 86322   IN  A   54.76.124.182]

Also noticed the following:

@ r resolve ("im.plä.net.", classOf[A]) 
Jul 12, 2017 3:44:33 PM de.measite.minidns.DNSClient query
WARNING: The DNS server /131.188.34.40 returned a response without the "recursion available" (RA) flag set. This likely indicates a misconfiguration because the server is not suitable for DNS resolution
Jul 12, 2017 3:44:33 PM de.measite.minidns.DNSClient query
WARNING: The DNS server /131.188.0.10 returned a response without the "recursion available" (RA) flag set. This likely indicates a misconfiguration because the server is not suitable for DNS resolution
Jul 12, 2017 3:44:33 PM de.measite.minidns.DNSClient query
WARNING: The DNS server /131.188.0.11 returned a response without the "recursion available" (RA) flag set. This likely indicates a misconfiguration because the server is not suitable for DNS resolution

Needs more investigation.