Setting static IPv4 and IPv6 static addresses for a MAC

On Pihole I’m able to attribute a domain name and a static IPv4 address for each device on my LAN based on its MAC. But I can’t find out how to attribute IPv6 addresses (link-local, ULA and global) to them.

When there’s already a record for a MAC, Pihole doesn’t let me add another one to try to set IPv6 to it.

I’m still pending find out how to delegate IPv6 global prefix to Pihole/dnsmasq using DHCP-PD, because I’m moving my router to OpenWRT, but while that’s not done I’d like to set static link-local and ULA to devices, so I can attribute local domain names to them.

IPv6 does not use MAC addresses.

1 Like

IPv6 replaces the burned in MAC with a generated DUID. Because of the privacy features built in to IPv6 the identifiers may be randomized on each boot of the client.

1 Like

Oh I didn’t know about it!

So in place of using a MAC I need to place a DUID, and then attribute a domain name to it?

Sorry for being noob, but how in Pihole do I find devices’ DUID? And how does Pihole handle global prefix with DHCP-PD and ULA?

Yesterday I started working on my new OpenWRT router and its DHCP+DNS server is working fine in setting IPv6 global and ULA addresses. Is it worth setting it to delegate DHCP-PD global prefixes do Pihole’s dnsmasq to do the distribution? Or should I let OpenWRT do the job and leave Pihole only for DNS resolving?

If you’re delegating prefixes then best is just let the router do what it does better. ULA is fine on Pi-hole, just enter the subnet and length in the box provided.

1 Like

Indeed, I disabled DHCP on pihole and just let OpenWRT’s do it. It’s just easier that way.

I was also able to edit OpenWRT’s dnsmasq to advertise Pihole as DNS resolver to my LAN, I’m almost sure it’s working.