A while ago I decided to adopt IPv6 (next to IPv4) for my local network, which consist of a DSL modem (bridge), gateway/router annex Wi-Fi Access Point (running dd-wrt) and a dedicated Pi-hole (NanoPi NEO2). My pi-hole originally acted as DHCP server in order to have the hostnames displayed in the query log without the need for 'conditionally forwarding' those requests to my gateway (which in fact acted as DHCP server on the LAN side pre Pi-hole).
However to enable IPv6 on the internet I had to activate RA (Router Advertisements) on my dd-wrt router. Activating 'Enable IPv6 support (SLAAC + RA)' (which in fact is more than SLAAC+RA, namely with the addition of dnsmasq's stateless DHCPv6 providing dns-server information) on the DHCP settings did introduce some 'problems':
- IPv6 hosts soliciting receive two responses, i.e. one from the real gateway (router) and one from Pi-hole (no acting as a gateway), a result every hosts assigns itself two global IPv6 addresses;
- Pi-hole hostname resolution became a mess, i.e. not resolving the IPv6 addresses generated triggered by the router's advertisements.
In order to overcome these issues I have changed my configuration back to having my gateway/router do DHCP and internal DNS (hostname lookup) by means of dsnmasq. However to enable IPv6 DNS resolution (since Pi-hole runs on a different machine and IPv6 RA does not sent specific DNS-server info) I have added additional options to dd-wrt's dnsmasq (see below). I de-activated radvd on dd-wrt since dnnmasq handles the router advertisements. After enabling "Use Conditional Forwarding" on my Pi-hole everything now works fine with IPv6 (and IPv4).
(/tmp/dnsmasq.conf on dd-wrt, lines until 'additional options' are generated by dd-wrt, dependent on the options activated in dd-wrt UI, additional options are entered manually in UI)
interface=br0
resolv-file=/tmp/resolv.dnsmasq
domain=local
dhcp-leasefile=/tmp/dnsmasq.leases
dhcp-lease-max=48
dhcp-option=br0,3,192.168.168.168
dhcp-authoritative
dhcp-range=br0,192.168.168.200,192.168.168.239,255.255.255.0,1440m
dhcp-host=00:00:00:00:00:00,M-SERVER,192.168.168.2,1440m
dhcp-host=00:00:00:00:00:00,N300A-IP,192.168.168.3,1440m
bogus-priv
conf-file=/etc/rfc6761.conf
clear-on-reload
dhcp-rapid-commit
stop-dns-rebind
dhcp-option=252,"\n"
cache-size=0
dns-forward-max=150
#additional options
local=/local/
#expand-hosts
dhcp-option=br0,option:dns-server,192.168.168.192
dhcp-option=br0,option6:dns-server,[fe80::1:f0ff:fee7:9c07]
dhcp-range=br0,::,constructor:br0,ra-names,ra-stateless,64,1440m
Hope this will solve internal hostname lookup for others using IPv6.