Force use of IPv6 address over IPv4 address

domain-name-systemipv4ipv6nslookup

I'm attempting to serve a website from a machine that only has an IPv6 address. I have purchased a domain name and changed the AAAA record of the DNS resource record to my IPv6 address, and have verified that this change has been updated using nslookup --query=AAAA example.com. However, when I navigate to my page, it resolves to the default site provided by my domain registrar, which is hosted at the IPv4 address in the A record.

In addition, I've tried to set the A record to an invalid IPv4 address, but no dice.

How can I force the use of the IPv6 address?

Best Answer

If you want to force all users accessing a domain to do so over IPv6 rather than IPv4, the correct way to do so is to simply not publish any A record.

From the additional information provided in the comments I understand that your current DNS hosting provider does not support a correct configuration. That means you'll have to switch to another DNS hosting provider.

If for some reason you want to stay with the current provider, there is another way to force clients to use IPv6 even when there is an A record. You can point the A record to an IPv4 address which responds with a TCP RST packet to every connection attempt. Most clients with IPv6 access will switch to IPv6 if they get a RST over IPv4.

But don't just point your A record to some random IPv4 address which happens to be responding with RST at the moment. You need to ensure that you have an agreement with whoever is responsible for the host on the IPv4 address you point to, before you start using it.

Related Topic