Can a domain name have both IP addresses (IPv6 and IPv4)?

Can a domain name (example.com) have both the IP addresses, IPv6 and IPv4?

Which IP address does a domain name have? IPv6 or IPv4? But I am not sure that it has both or any one at a time.


Sure. You have an A record (for IPv4) and an AAAA record (for IPv6). Typically the AAAA record gets resolved first, then the A record.

You can either have just an A name (for an IPv4-only host), AAAA name (IPv6-only host) or both. You could even have different servers for both.

You could even have multiple A and AAAA names (for different dual-stack or mix of ipv4 and 6) servers.


Yes you can have both IPv4 and IPv6 addresses associated with the same dns name.

As a general rule services should be made available over both ipv4 and ipv6 and the same public facing DNS name used for both. That way both IPv4 only clients (still way too common) and IPv6 only clients (not very common yet) will be able to access it using the same name. In general dual stack clients will try IPv6 first before falling back to IPv4 though there is no hard and fast rule.

It is often useful to have additional dns names that only offer one protocol so that you can test your server works correctly on both protocols but these names should not generally be promoted to users.

If you only offer IPv4 then pretty much everyone will be able to access your site but as the IPv4 crises bites deeper an increasing proportion of users will be connecting via some form of ISP level NAT service (be it conventional v4 NAT, NAT64 or ds-lite). ISP level NAT services make tracking/blocking/reporting abuse much harder.

If you only offer IPv6 then a substantial proportion of users will not be able to access your server.