A Network Access Issue Caused by DNS64
Background
While I was troubleshooting a network access issue last night, I found an interesting issue caused by DNS64. So I spent some time research what's the DNS64 feature is , why it's causing problem to me and how to fix it.
The Issue
During the troubleshooting, I noticed that some of the network connection between my computer and zhihu-web-analytics.zhihu.com failed. More specifically, get timed out. I suspected there might be some heavy packet loss along the network path, so I tried to use mtr to check if that's the case.
My traceroute [v0.95]Bob-Desktop (2600:1700:5050:bcf:22d3:cd56:fda7:fe3a) -> zhihu-web-analyt2022-08-13T16:50:00-0700Keys: Help Display mode Restart statistics Order of fields quitPackets PingsHost Loss% Snt Last Avg Best Wrst StDev1. OPNsense.localdomain 0.0% 4 0.1 0.1 0.1 0.2 0.02. (waiting for reply)3. 2001:506:6000:11b:71:165:123:86 0.0% 4 2.2 2.1 1.9 2.2 0.14. (no route to host)
Hey, no route to host. How come? And it's using IPv6. Am I accessing an IPv6 site? What's the IP address for zhihu-web-analytics.zhihu.com?
nslookup does show me botht he IPv4 addreass and IPv6 addresses tied to the DNS name.
$ nslookup zhihu-web-analytics.zhihu.comServer: 127.0.0.53Address: 127.0.0.53#53Non-authoritative answer:zhihu-web-analytics.zhihu.com canonical name = gslb-offline-pkx01.zhihu.com.gslb-offline-pkx01.zhihu.com canonical name = lb-pkx01-offline.zhihu.com.Name: lb-pkx01-offline.zhihu.comAddress: 192.144.195.62Name: lb-pkx01-offline.zhihu.comAddress: 140.143.214.102Name: lb-pkx01-offline.zhihu.comAddress: 64:ff9b::c090:c33eName: lb-pkx01-offline.zhihu.comAddress: 64:ff9b::8c8f:d666
Oh, wait! Why does the IPv6 address all started with 64:ff9b, which is the special IPv6 address range reserved for IPv4/IPv6 translation. It seems that the DNS name do not have a real IPv6 IP address assigned to it. The DNS resolver I am using is tring to translate the IPv4 IP address and providing translated IPv6 IP address for the IPv4 address. However, there is no NAT64 configured on my Intnert gateway, the IPv6 traffic to those 64:ff9b IPv6 address will not be translated to IPv4 traffic, then routed to my upstream Internet service provider.
The Fix
To fix the issue, I looked through the configuration for the DNS resolver and I noticed the DNS64 feature was indeed being enabled. I went ahead and disalbed the feature. After that, the DNS resolver will not create those 64:ff9b response for IPv4 only hosts. Here is the result after the issue is fixed.
$ nslookup zhihu-web-analytics.zhihu.comServer: 127.0.0.53Address: 127.0.0.53#53Non-authoritative answer:zhihu-web-analytics.zhihu.com canonical name = gslb-offline-pkx01.zhihu.com.gslb-offline-pkx01.zhihu.com canonical name = lb-pkx01-offline.zhihu.com.Name: lb-pkx01-offline.zhihu.comAddress: 140.143.214.102Name: lb-pkx01-offline.zhihu.comAddress: 192.144.195.62
Comments
Post a Comment