Pihole hostname?

abishur

Dabbler
Joined
Jun 28, 2022
Messages
26
Hello all! I installed TrueNas for the first time on an r720xd today and am learning the ropes. One area of particular interest to me are the apps. I've installed Pi-Hole using the truecharts... image? Container? And in the container it lists my hostname as a very long thing. I'd like to change this so I opened up a shell instance went to /etc/ and tried to edit hostname with vi and nano, but those don't exist in the container.

So here's the question 1) How to I edit the hostname to something more descriptive to me and 2) Am I being stupid missing a fundamental truth about these containers? Is the whole point that they are disposable so you don't worry about hostnames like that? Obviously with using the PVC options I can keep the docker image updated without loosing my configurations each time, but am I just grossly over thinking this?
 

LarsR

Guru
Joined
Oct 23, 2020
Messages
719
container on scale get destroyed on shutdown and created on startup, so their name changes with every start.
 

abishur

Dabbler
Joined
Jun 28, 2022
Messages
26
Interesting. There's a part of me that is horrified at the thought of an integral part of a system being re-created each time I boot, but that's the point of PVC, my settings are preserved on the recreation.

Is there no way to make the hostname static, like an environmental variable I could set in the settings of the container?
 

neofusion

Contributor
Joined
Apr 2, 2022
Messages
159
This is just an idea, I have not used Docker in TrueNAS.
Reading the official guide I see that they use Pihole as an example app.

In the part that deals with volume setup they show two volumes being created beforehand on a normal dataset, /mnt/pool1/pihole/etc/pihole and /mnt/pool1/pihole/etc/dnsmasq.d with the idea that they store data persistently, presumably to facilitate upgrades but also restarts (?).

Can you SSH to the NAS (not the container), then go to the relevant /mnt-spot and use TrueNAS's standard text editor to edit /etc/pihole/pihole-FTL.conf and/or /etc/dnsmasq.d/01-pihole.conf as appropriate?
 
Last edited:

DaSnipe

Explorer
Joined
Jun 26, 2021
Messages
86
Interesting. There's a part of me that is horrified at the thought of an integral part of a system being re-created each time I boot, but that's the point of PVC, my settings are preserved on the recreation.

Is there no way to make the hostname static, like an environmental variable I could set in the settings of the container?
Looking at the docker environmental variables, it looks messy, you can see if adding one here helps:

https://github.com/pi-hole/docker-pi-hole#readme

But I mean the hostname at the top isn't something I worry about, what are you querying by hostname
 

phradr

Dabbler
Joined
Sep 27, 2022
Messages
49
Came here because of another error I was facing - already solved that one.

But maybe someone else is looking for similar information: you can pass environment variables into the app.
Here (LINK) you will find a fully supported list of variables, maybe you might be looking for VIRTUAL_HOST as I was.

This will not solve the thread owners issue (long hostname), but maybe some other ones regarding access, permissions and a lot of others.
 
Top