failed because: de.measite.minidns.hla.ResolutionUnsuccessfulException: Asking for xxxx. IN AAAA yielded an error response NX_DOMAIN
Asked Answered
D

1

9

After I upgraded smack to 4.2.0 I am getting connection issue.

The following addresses failed: 'xxxx:5222' failed because: 

de.measite.minidns.hla.ResolutionUnsuccessfulException: Asking for xxxx.    IN  A yielded an error response NX_DOMAIN, '52.90.233.38:5222' failed because: de.measite.minidns.hla.ResolutionUnsuccessfulException: Asking for xxxx. IN  AAAA yielded an error response NX_DOMAIN

the issue happen when host is set in connection configuration builder.

example :

.setHost(ServiceConstants.CHAT_SERVER)

See https://github.com/igniterealtime/Smack/wiki/Smack-4.2-Readme-and-Upgrade-Guide

This is my final configuration, it worked after Davood Falahati help !

InetAddress inetAddress = InetAddress.getByName(ServiceConstants.CHAT_SERVER);
            XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder()
                    .setXmppDomain(JidCreate.from(ServiceConstants.CHAT_SERVER).asDomainBareJid())
                    .setPort(5222)
                    .setHostAddress(inetAddress)
                    .setDebuggerEnabled(true)
                    .setSendPresence(true)
Daley answered 1/4, 2017 at 17:43 Comment(1)
Possible duplicate of Error on smack 4.2.0 : IN AAAA yielded an error response NX_DOMAINTribromoethanol
T
10

This problem mainly occurs in local networks when the xmpp server is not configured in local DNS. To solve the problem, explicitly address the xmpp server and use

setHostAddress(InetAddress address)

see my answer here

Tai answered 2/4, 2017 at 2:31 Comment(2)
Thanks, I will check that outDaley
This resolved the issue, see github.com/igniterealtime/Smack/wiki/… alsoDaley

© 2022 - 2024 — McMap. All rights reserved.