Pi-Hole running in TrueNas Community Edition, but not working as DNS server

I am running TrueNas 25.10.1 - Goldeye Community edition. All file server functions are working great. I am running the system on an old Lenovo laptop and using the two drive bays inside for 2TB mirrored configuration for storage pool. Running a USB SSD for boot pool. Works very well for file server needs.

Trying to deploy Pi-Hole on this system. I am using the standard TrueNas app catalog and the persion of Pi-Hole there is 1.3.25. I am able to deploy the app and access its web IU. But I am not able to get it to respond to DNS queries on my LAN. I set DNS server address on my LAN router to TrueNas and no DNS responses occur. I have to go back to default DNS settings in order to have internet access and “queries blocked” stats on the Pi-Hole web IU stay at zero. I am used to running Pi-Hole on bare metal of raspberry pi, but at the moment I do not have access to one and am trying to deploy Pi-hole on TrueNas. I understand it’s a docker container on Tnas and I am not very educated about this aspect yet. But I seem to have deployed the app properly as it shows up its web UI in my LAN and I can interact with it. TrueNas reports everything running properly. But I am not able to make the Pi-Hole respond (or “hear”) the DNS queries. I tried options to Publish port on the host for external access. No joy. Is what I am trying to do even possible? Seems like Pi-hole needs port 53, which is available, but somehow the configuration doesn’t work.

Need help, even if the answer is: “Can’t be done”, so I stop wasting time. I also hear about Chart version of Pi-Hole. What is that? Will that work?

Thank you in advance!

It for sure can be done. You might check the logs on the container and see if there is anything going on there. Also, do you have firewall rules blocking DNS traffic?

Here is a guide: Pi-hole Deployment | TrueNAS Apps Market

Well, among other things, you can check the PiHole GUI under settings/DNS and make sure it’s set to “Permit all origins” and check the app’s install under Additional Environment Variables to be sure it’s connected to the Truenas interface. Also you might try restoring the router’s DNS to its prior setting and point the PC/client’s DNS to the PiHole/Truenas ip address. I’ve found that the PiHole Community Forum may also be helpful.

1 Like

Can you expand on environment variables, please? I have no idea what ones to set and how. I have just left all that stuff blank.

That is a very outdated tutorial. Current version is very different. No need to provision storage, etc. Anyway, there is no new information in there. I did everything outlined there, save for newer way of provisioning storage, which the system does automatically now. My Pi-Hole is up and running just fine. But it is not working as a DNS server. It is not responding to DNS queries. I think it is not being reached by my router for some reason.

For the official PiHole app to connect with the network an additional environment variable must be set. Edit the app, then select add under Additional Environment Variables. In the drop down menu select “Interface” and then type in under “Value” the name of your Truenas interface which is found in the GUI under network. I’m running TN25.04.2.6 so I think the edit app screen might be different in 25.10.1 and the network info in the GUI was moved to a general menu. The interface name should be something like: e***

1 Like

I tried adding an environment variable “Interface” with value of enp0s25, which is what I found in the Tnas System→Network. No change in behavior. Still not responding to DNS queries. I am beginning to think this may not be possible, unfortunately :frowning: At least in my situation. Though my situation is very ordinary. Tnas is running on the LAN and working perfectly as a smb server. I have not tried other apps. The one I really want to use is pi-hole. I will try to deploy it on separate linux machine in a container. Not sue if that will work… I may just have to dig up my old Rasperry Pi 3, which ran it perfectly. Thank you for trying to help. I will keep hoping and researching, but at this point I have way more time into it than its worth. This should not be this hard. Oh, and my environment variable field was not a drop down, it was a text input, as was the value field.

There are at least 3 ways to run PiHole on Truenas: 1) the official app; 2) a custom app using a yaml file; 3) running it in a VM on some OS. I’ve been doing the official app and running it in a VM on Ubuntu server with Unbound. After devoting some time and effort to the initial installs both instances have been mostly trouble free for a couple of years despite using my ISP’s proprietary router. A last suggestion would be to check port 53 as published for external access.

New information! I tried to set the DNS server on my laptop to point to Pi-Hole and it started to work. Only on that laptop, naturally, but I started seeing stats on pi-hole dashboard and I could get to websites. If I try to set my router to point to pi-hole, it does not work. Same LAN. So pi-hole is listening and responding, but the router is not able to talk to it for some reason. I have an ISP provided Nokia router that can be set to point to a custom DNS server via a phone app, not web UI. On web UI DNS option is greyed out. I may try another router and see if that’s the problem. It appears I can set the IP address of the DNS server, but when I do, nothing works. It may be looking for a WAN address, not LAN, perhaps? So I may be having a problem not related to pi-hole. If that is true, then a separate Raspberry pi running pi-hole won’t solve the problem.

1 Like

Replaced the ISP provided router, Nokia WiFi Beacon 3.1 (given to me for free with fiber ISP install) with an older Netgear Orbie, which does allow to set the DNS server AND actually uses that setting regardless of whether said server is on the LAN or outside. Pi-hole now works fine on the router level. Now I just need to figure out if I can setup unbound on TrueNas to make Pi-hole use that. But the TrueNas container running Pi-Hole is all good now.

2 Likes