With IPv6, clients may join a network using SLAAC, Stateful or Stateless DHCPv6.
Only the latter is similar to DHCP for IPv4, where a DHCP server assigns an address to a client requesting one.
In all other cases, a client will construct its IPv6 addresses autonomously, procuring information as required. Most importantly, a public IPv6 prefix (as offered by a router or a DHCPv6 server) is picked up by a client for constructing a public address. The same is true for a local ULA prefix, provided that's available.
Chances are that your IPv6 addresses aren't static.
In fact, they are even designed to change, depending on both your client's and your network's configuration.
When considering an IPv6 address for Pi-hole, you should probably avoid using a public address (2000::/3
range) altogether: Not only is Pi-hole not meant to be publically available, but with a public IPv6, both your IPv6 prefix and the interface identifier are subject to change (the former by your ISP, the latter by IPv6 Privacy Extensions and the likes), and Pi-hole requires a stable address.
That said, I'd advise against manually defining a static IPv6 address in dhcpcd.conf
, unless you are familiar with IPv6 and willing to also manually handle IPv6 prefix changes as potentially imposed by your ISP (some ISPs routinely shift IPv6 prefixes for consumer plans).
To keep at least a stable prefix, you could configure a ULA prefix (if your router supports it), and have your router advertise Pi-hole's ULA address (fd00::/8
range).
If using an IPv6 ULA address is not an option with your router, try using your Pi-hole's link-local IPv6 address instead (fe80::/10
range). Link-local addresses are also the least likely to change.
However, note that such an address is only accessible for devices on the same network segment.
You can list all current IPv6 addresses for your Pi-hole by running:
ip -6 address show