Pi-hole as a DHCP / Dual Stack IPv4 & IPv6 and Clients Hostnames + - FritzBox Settings Help

I would select the option in the first picture (disable DCHPv6 in the FRITZIBox) for the SLAAC possible.

Hi, jfp,

That option is what I have been running. IPv6 and IPv4 are working great.

My only issue remaining is the Clients list showing hostname and IPv6 other than just hostnames…

Not a real drama but it would make identify users a little faster.

2

You might need to add an entry in a dnsmasq config to map IPv6 reverse lookups to your router’s IPv6 address.

Something like:

server=/fd00.in-addr.arpa/[IPv6 router address]

I have solved the ipv6 reverse lookup issue based on Mcat12’s suggestion above. I am using lede/openwrt based router for DHCP duties and as such have to use conditional forwarding in the DNS section of pihole.
Although the suggestion above was not entirely correct, i did some digging and have come up with this:

Assume your ipv6 ULA-Prefix is fd0a:1234:5678::/48
also assume fd0a:1234:5678::1 is router’s ipv6 address

Add an entry into /etc/dnsmasq.d/01-pihole.conf as follows:

server=/8.7.6.5.4.3.2.1.a.0.d.f.ip6.arpa/fd0a:1234:5678::1

Save and reboot

Now ipv6 gets resolved to hostname properly in the query log.

test
dig -x fd0a:xxxx:xxxx::233

; <<>> DiG 9.10.3-P4-Raspbian <<>> dig -x fd0a:xxxx:xxxx::233
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15886
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;3.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.x.x.x.x.x.x.x.x…a.0.d.f.ip6.arpa. IN PTR

;; ANSWER SECTION:
3.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.x.x.x.x.x.x.x.x.a.0.d.f.ip6.arpa. 0 IN PTR Nest.lan.

;; Query time: 137 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Sep 05 13:11:26 EDT 2018
;; MSG SIZE rcvd: 123

Once Mcat12 has a look and replicates what I’ve done reliably we can finally put this ipv6 hostname resolution thing to bed! Again I am using conditional forwarding option in pihole and my router as my DHCP server so I’m not exactly sure if this will translate well into the pihole as a DHCP server configurations. However it has solved the issue for me in my setup.

I’m away for a couple of days but will check your solution as soon as I’m back. Thank you.

Ok cool. I don’t want to mark it solved until I get confirmation from a few other people.

If it works as expected, then it’s solved. I am unable to replicate this as I do not have full IPv6 connectivity.

It does work somewhat. After 18 or so hours my query logs show one or two ip’s rather than the hostnames. I think the conditional forwarding for IPv6 is not getting the PTR records correctly. The arpa commands are different for IPv6 so possibly need to get corrected within pihole code. I’m going to investigate a little further to see what I can come up with.

Follow up: I added a line to the /etc/pihole/setupVars as it sets the parameters for conditional forwarding.

CONDITIONAL_FORWARDING_REVERSE=x.x.x.x.x.x.x.x.a.0.d.f.ip6.arpa

Not entirely sure if its necessary but it didn’t break anything so I’ll leave it for now.

Edit - Turns out it is not necessary and may cause issues so I’ve taken it out.

I’m finding that for ipv6 hostname resolution you are heavily dependent on your router and/or DHCP server to have the hostnames correctly mapped to the ipv6 of the clients. As such it doesn’t always resolve right away and could take some time before the pihole gets the hostnames returned from the router.

I’m using the Pi-hole as DHCP and adding the line above with my values is not really making any difference.

I have a file in /etc/dnsmasq.d/ with custom settings.
In this file I added the following line:

server=/d.f.ip6.arpa/fd00:1234:5678:1

(fd00:1234:5678:1 is the ULA ipv6 address from my FRITZ!Box shown in the settings)

After restart pihole I can do nslookup to any ULA in my network and get a name. But not all devices give me an address back but I think that’s normal.

Some news here? I run into the same problem. IPv4 hosts are resolved without problems but IPv6 don’t. I tried the extra line in a custom dnsmasq.d file but it doesn’t work for me. Some other ideas? nslookup doesn’t work either.

Depends on your setup. Are you using pihole as DHCP server? I suspect you are not so I’ll tell you what I’m using. DHCP is done by my router which is running LEDE/OpenWrt and the pihole conditional forwarding option with said router. On the router I am using ip6neigh script to update IPv6 hostnames. For me it works perfectly to resolve hostnames for IPv6. As well as the options I’ve outlined above. The problem is conditional forwarding relies on the router to provide the correct hostnames for IPv6 when queried so it’s heavily dependent on the router and or it’s firmware.

Link for ip6neigh script page:

Once I get some time I will provide a tutorial to setup for those with lede/OpenWrt and conditional forwarding. I assume those with pihole doing the dhcp have no issues as the pihole always knows the hostnames attaches to the IPv6 addresses as it is providing them in the first place.

No unfortunately, I started the thread because the Pihole DHCP is not resolving the hostnames attached to ipv6. Not a real issue anyway

I think the problem boils down to the main developers and possibly mods here don’t have or don’t use IPv6 so it’s difficult to have them tweak the code. The pihole would have to keep track of IPv6 addresses and their associated hostnames in a separate discovered hosts log file internally like my router does. Reverse dns for IPv6 does work though it just needs to be coded correctly for queries.

Okay thanks. I’m not using the pihole as DHCP too. But instead of your LEDE/OpenWrt Router I’m using a Fritz Box. Seems like the Fritz Box doesn’t allow the IPv6 reverse dns so the pihole can’t resolve the hostnames for IPv6 addresses. Maybe AVM patch the software someday…

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.