IPv6 DNS server configuration not working for me in MacOS Catalina
I have a use case where I want to use custom IPv6 DNS server and not 8.8.8.8/8.8.4.4 Somehow even after cleaning up DNS cache and configuring only the custom IPv6 DNS server, all my domain name resolutions traffic is going to 8.8.8.8
Following are the things I tried:
Tests-MacBook-Pro:~ root# networksetup -getdnsservers Wi-Fi
There aren't any DNS Servers set on Wi-Fi.
Tests-MacBook-Pro:~ root# ping6 -c4 www.google.com
PING6(56=40+8+8 bytes) a:b:c:d::1 --> 2404:6800:4009:800::2004
--- www.google.com ping6 statistics ---
4 packets transmitted, 0 packets received, 100.0% packet loss
Tests-MacBook-Pro:~ root# sudo killall -HUP mDNSResponder
Tests-MacBook-Pro:~ root# networksetup -setdnsservers Wi-Fi aa:bb:cc:dd::1
Tests-MacBook-Pro:~ root# networksetup -getdnsservers Wi-Fi
aa:bb:cc:dd::1
Tests-MacBook-Pro:~ root# ping6 -c4 www.google.com
PING6(56=40+8+8 bytes) a:b:c:d::1 --> 2404:6800:4009:800::2004
--- www.google.com ping6 statistics ---
4 packets transmitted, 0 packets received, 100.0% packet loss
Tests-MacBook-Pro:~ root#
test@Tests-MacBook-Pro ~ % sudo tcpdump -eni any port 53
Password:
tcpdump: data link type PKTAP
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type PKTAP (Apple DLT_PKTAP), capture size 262144 bytes
17:08:18.556115 a:b:c:d:e:f > f:e:d:c:b:a, ethertype IPv4 (0x0800), length 74: 192.168.1.103.50080 > 8.8.8.8.53: 42215+ AAAA? www.google.com. (32)
17:08:18.562506 f:e:d:c:b:a > a:b:c:d:e:f, ethertype IPv4 (0x0800), length 102: 8.8.8.8.53 > 192.168.1.103.50080: 42215 1/0/0 AAAA 2404:6800:4009:800::2004 (60)
Here I was expecting that the DNS resolution request should be sent to aa:bb:cc:dd::1 and expecting to receive the IPv6 address from subnet a:b:c:d::/64 but it got sent to 8.8.8.8 and received address 2404:6800:4009:800::2004 which as of now is not routable from my VPN server(as it is using NAT64 internally). I am able to do ping6 to IPv6 DNS server aa:bb:cc:dd::1, also I am able to do ping6 to a:b:c:d::0808:0808 which is translated to 8.8.8.8 by VPN server.
I have also experimented with scutil command tool, but still not able to resolve the issue.
Can someone please help me resolving this issue?
Thank you.