IPv6 Networking – Modem Does Not Resolve Local Hosts

dnsipv6networkingnslookuprouting

I am having fun with creating some small Raspberry Pi web servers with IPv6. However, my Android phone cannot reach those, due to some DNS problem.

Here is the situation.

I registered a domain name for just 10 euro per year, let's call this mydomain.nl . I created some local servers like: www.mydomain.nl and meter.mydomain.nl. Using IPv6, both servers can be accessed globally without the old Network Address Translation (NAT) stuff. This all works nicely from any laptop at home or outside, as long as I configure DNS to e.g. 8.8.8.8.

The problem is that I don't know how to configure DNS in the Android phone, so I have to work with the default DHCP settings.

I found out that half of all internet providers do not support IPv6 yet, like T-Mobile and Vodafone, and my phone is on T-Mobile. But even when on the wifi at home, with Xs4all cq KPN, that does support IPv6, like Ziggo, my phone cannot find the two raspberry pi hosts.

I did not configure IPv4 on those hosts, because IPv4 cannot be used to expose two local hosts to the external internet.

I tested DNS resolution with PING, NSLOOKUP, and HOST. DIG is also a neat tool. I drilled down the problem to the internet modem (router), a Fritzbox 7590, with local IP address 192.168.3.27, and also an IPv6 host address. The Fritzbox uses four DNS servers: 195.121.97.202 and 3 others, of which 2 IPv6 DNS server addresses.

enter image description here

With this command I checked that each of those DNS server addresses can find the IPv6 addresses of my Raspberry Pi servers correctly:

nslookup meter.mydomain.nl 195.121.97.202 # OK: IPv6 address found

However, with the same command but with name server = 192.168.3.27, i.e. the address of the Fritzbox, can NOT FIND the Raspberry Pi servers:

enter image description here

nslookup meter.mydomain.nl 192.168.3.27 # ERROR: no address found

Still, the Fritzbox does resolve for external IPv6 servers, e.g.:

nslookup ipv6.google.com 192.168.3.27 # OK: IPv6 address found

Now this is unfortunate, as when I look in the Settings of the Android phone, this last one, 192.168.3.27, is used for the DNS. Plus additional IPv6 addresses, but these refer to the same Fritzbox.

So the problem drills down to the following:

  1. On the phone I use Firefox to surf to the URL: meter.mydomain.nl
  2. The phone uses DNS on the fritz.box to resolve that URL
  3. The fritzbox is configured to some DNS servers that can resolve that URL, but the phone does NOT receive the IP address, and firefox reports: Addres Not Found.
  4. The phone can find external IPv6 sites just fine, like ipv6.google.com

And the real problem:

For my phone on the wifi, the Fritzbox DNS can resolve external IPv6 hosts like ipv6.google.com, but not local IPv6 hosts like my Raspberry Pi servers, while the DNS servers used by the Fritzbox can find all these servers just fine.

How to fix this?? I am out of wits …

By the way, I actually checked with 5 Android phones, with Android versions 8, 11, 12, 13, but I don't think the problem is in the phone. All use the same fritzbox address for DNS. At none of those I found a setting to change DNS server.

I found a workaround: you can add a DNS server in the Android phone, under Settings, Network, Private DNS. You cannot enter an IP address, but can enter a host name, e.g. for 8.8.8.8 you add dns.google, or for 1.1.1.1 you add 1dot1dot1dot1.cloudflare-dns.com .

But why resolve all your dns queries using google first, is that desirable with respect to privacy? So I see this as a workaround. We should fix problems where they appear, so I leave this question open.

The workaround to avoid google is to find the host name of the IP address of the DNS server that the Fritzbox uses. But again, I'd like to fix this problem at the modem (router) itself.

Best Answer

To my surprise, this problem turns out to be not a bug, but a feature!

This note from the modem manufacturer says that DNS is deliberately blocked for local hosts to avoid DNS Rebinding Attacks.

The note also describes how to configure an exception, that worked just great.

I found this solution by googling this question together with mention of the Fritzbox model. It would have saved a lot of trouble, and this question, if I had googled that way. But perhaps you can only think of such google search after analyzing the problem this far.

Related Question