Pi-Hole IPv6 Static IP settings - And some issues with Name Resolution

Probably answered elsewhere, but I need to be sure:

I want to shorten my Pi-Hole's IPv6 address to make me remember it easily.


Currently it is a pretty long one, not easy to remember in /etc/pihole/setupVars.conf. This is how it looks:

IPV6_ADDRESS=fd00:1111::[..omitted..]:35b8

  • Is /etc/pihole/setupVars.conf the only place where the IPv6 static address to use must be defined?

  • Can I safely assume if I set f.e. IPV6_ADDRESS=fd00:1111::1001 in /etc/pihole/setupVars.conf it will properly update/set the IPv6 address of interface eth0 to the defined static fd00:1111::1001 address?

  • Then I can simply use the short fd00:1111::1001 IPv6 as the DNS server address to use in DHCP and direct client configs.

  • Please confirm or advise what would work.

  • I would test this myself but rather avoid it on a live system.


I am asking, because I previously had IPV6_ADDRESS=fd00:1111::[..omitted..]:9999 defined in setpVars.conf.

  • This was the IPv6 ULA of my Raspberry Pi 2.

I had to switch Pi-Hole to a Raspberry Pi 3 due to hardware defect on Pi 2.

  • I have bootet a SD card clone in the Pi 3. So setupVars.conf still had the Pi 2 IPv6 ULA defined IPV6_ADDRESS=fd00:1111::[..omitted..]:9999.

  • However, this IPV6_ADDRESS=fd00:1111::[..omitted..]:9999 was not used by Pi-Hole to update the interface eth0 IPv6 in use.

  • Instead, the interface eth0 on Pi 3 got a different ULA assigned to it, IPV6_ADDRESS=fd00:1111::[..omitted..]:35b8.

  • I actually had to update setupVars.conf and DHCP/DNS settings to use the new Pi 3 ULA IPV6_ADDRESS=fd00:1111::[..omitted..]:35b8.

Conclusion:
I expected the IPV6_ADDRESS= setting would update the actual network interface IP. But that's not the case, I had to get the changed ULA from ifconfig and add it to setupVars. That's not the way it's supposed to work, is it?

All the tutorials I find on IPv6 static say define it in setupVars.conf and be done. But in my case the eth0 simply doesn't get the IP assigned that's defined in setupVars. What am I doing wrong?

Short:
How to actually set some permanently static IPv6 ULA like fd00:1111:1 to the Pi-Hole, when setupVars.conf approach ain't working?

1 Like

I'd advise against setting static IPv6 addresses on device, unless you are sufficiently familiar with IPv6 and fully aware of the associated consequences.

For your Pi-hole machine, try instead to set a fixed IPv6 interface identifier for that device in your Fritzbox.

Be aware that such an interface identifier only ever gets assigned for those clients requesting it via Stateful DHCPv6. Most clients won't by default, and some never will (e.g. Androids).
See also Pi-Hole IPv6 - Hostname resolution noob questions - #15 by Bucking_Horn, where you asked almost the same question.

In general, don't change setupVars.conf by hand.
Pi-hole's installation, update, repair and reconfigure scripts will read and write information from and to that file.
To reconfigure Pi-hole for changed network settings (i.e. a changed IP in your case), run pihole -r and choose Reconfigure.

2 Likes

Out of curiosity, why do you want to remember the IPv6 address? Usually names are easier to remember than long numbers. If you map the IP to a simple name, then you only have to remember the name.

Additionally, since you can communicate with the Pi-hole easily with IPv4, you can remember that IP.

Well, it seems I wanted to have a static IPv6 as I have already with IPv4, but it seems IPv6 works differently here and there. My idea was, while I yet don't exactly understand how IPv6 addresses are generated, I'd use a easy to remember static address. But it seems there are security implications and whatnot by doing so, thus I refrain from it for the time being.

IPv6 is rather complicated for a guy who runs his own DNS as hobby, it does things where I don't know which is the next step in fixing problems. Tho, since my new ISP is native IPv6 its kinda the time to port my network to IPv6.

Already learned a lot (thank you Pi-Hole community :slight_smile: ), in general my net seems fine so far, except the NAS, which is acting up, but from what I can see in Pi-Hole, it should not.

As soon as I have enabled IPv6 on the NAS, is stopped being reachable via its Hostname, only direct access via the IPv4 and IPv6 address is possible at the moment.

It goes like this. Pi-Hole seems pretty well aware of the NAS hostname for each, address:

Any browser in my LAN somehow doesn't resolve the NAS hostname:

Windows Network / SMB doesn't show the mx-nas host anymore. However, its still detected partially by Windows in the "media" and "other devices" sections. I can still access my network shares via IPv4/IPv6 addresses, but not the hostname. And I'm to lazy to update all shares to use IP rather than hostnames right now, just to undo it once the name resolution works again.

So now I wonder

  • Why is the NAS the exactly one device in my net where name resolution doesn't work at the moment?

  • Pi-Hole knows all hostnames for IPv6 and IPv4. Something is still blocking the name resolution of my NAS. I have no idea where to look next whats causing this.

  • In the NAS settings, the hostname is still set to mx-nas (without .fritz.box local domain). But that shouldn't matter since the NAS was reachable under both hostnames, mx-nas and mx-nas.fritz.box with IPv4 only net.

  • Do I have to set the NAS hostname to mx-nas.fritz.box, including the local domain? In IPv4, the mx-nas hostname (without local domain) somehow was aliased and worked properly.

  • I have tried adding the NAS to Pi-Holes Local DNS settings. There I set 2 rules, IPv6 address to mx-nas hostname and IPv4 address to the same mx-nas hostname as well. Then the NAS is actually accessible via the hostname.
    Although, by doing so, the NAS acted up even more. Constantly logged me out of admin interface and said I changed the browser or rebooted the NAS (which I both did not).
    My self-assessed noob explanation for this behaviour would be: Sometimes browser/client PC uses IPv6 and sometimes IPv4 to send send requests to the NAS.
    If I do the login, let's say via packets sent over IPv4, and then the NAS opens a 2nd browser tab (it does that quite regularly), this 2nd tab might be communicating via IPv6 and thus the NAS thinks I changed the browser and logs me out of both browser tabs.
    As said, this only happens when accessing it via hostname mx-nas and the defined local DNS rules in Pi-Hole.
    When I just use the IPv4 or IPv6 address instead of the hostname, it works as intended and I can use multiple tabs without being logged out.
    Anyways, I made a support ticket at Synology, might be a NAS config issue. But for the Pi-Hole being involved part, what does the community think about what I experience and maybe there's a solution to be found right here.

Your life will be quite simpler if you remove IPv6 from your LAN. LAN clients don't need this to communicate with each other.

1 Like

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