I have a weird issue; for a single connect request to a server that has a single AAAA record my device runs two A queries instead and fails to connect.

My setup is as follows:

  • LAN (a regular router) without IPv6 connectivity
  • Android 10 with only WiFi connectivity, having one fe80: and two fd14: addresses
  • Debian box, wired, running dnsmasq, acting as the DNS server for all devices
  • dnsmasq will reply that website foo.com has an IPv6 of the Debian box, and no IPv4

I can:

  • Connect from my phone to the Debian box using literal IPv6 address
  • Connect from other devices to foo.com
  • Connect to foo.com from JuiceSSH
  • Do ping6 foo.com successfully in Termux on the phone

What I can't do, I can't connect from my phone to the Debian box via foo.com using regular apps such as Chrome, or my own app. JuiceSSH is the weird exception. I tried making a new app, adding INTERNET permission and this bit of code only:

thread {
    Socket("foo.com", 9000)

This works consistently with the apps such as Chrome in that it doesn't connect and—from what I see in dsmasq logs—performs two A queries (both with NODATA-IPv4 response). It never performs an AAAA query. Inet*Address.getAllByName() behaves in a similar way. I tested with another device running Android 6, same outcome.

What's going on here?

  • I'm not an expert in networking, but Android doesn't fully support IPv6, check the status on the related question: Does Android have support for IPv6?
    – Andrew T.
    Apr 9 at 19:51
  • @AndrewT. Some applications do resolve IPv6 on my device; also my app can connect to IPv6 for other users. So I keep thinking that something is weird about my setup
    – squirrel
    Apr 9 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.