Pi-hole is a nice replacement for the DNS that is usually included on a home router. It blocks ads, and can be configured to do a few other things to reduce home unnecessary or annoying traffic on your home network. I went into this one completely blind. I didn't read any real install guides except for what was on DockerHub. It turned an install that should have taken a few minutes into about an hour of toubleshooting, most of which had already been documented elsewhere. I still have not dug too deep into configuration or tinkered with it beyond setup, but i figured I should document the absolute basics prior to setting up the container.
I switch between my Ubuntu desktop and Photon virtual machines as my docker hosts. For something of this nature, I have found that a virtual machine tends to work out a little better than a workstation. The main reason is that workstations tend to have little bits and pieces of configuration changes to suit the user. Configuring the Pi-Hole container means that you will change /etc/resolv.conf and need port 80 available (according to documentation). The instructions should be similar across Linux docker host environments.
First thing to take a look at is if you have access to port 53 on the host. The lsof command is an excellent way to identify if it is being used, and what might be using it. The command is "lsof -i :53". Once you identify which service is using the port, you need to copy /etc/resolv.conf to /etc/resolv.conf.backup. Then you can stop and disable the service.
Aggregate 1
Good old article about finding port info
Once you kill the service, you will need to take a look at the original resolv.conf file. Perform an ll or ls -al of the file, "ls -al /etc/resolv.conf". In Photon it is a symbolic link, and will need a new link to work. You can link the backup over, "ln -s /etc/resolv.conf.backup /etc/resolv.conf". You should now be able to run the lsof command or netstat to see that nothing is using port 53 anymore.
There's been some minor chatter about different environment variables being required when running this container depending on version. That will have to be a trial and error situation. For the version I loaded, the key environment variables that I set were:
ServerIP Probably a little more important if you are running it on your workstation.
WEBPASSWORD Because we want the security.
DNS1 This did not load as a default in my build.
DNS2 This did not either.
The rest of the setup was exactly the same as what was described in the DockerHub documentation.
Aggregate 2
DockerHub PiHole
My next issue was an obvious RTFM problem. I was testing out the container on two different instances of Photon. One of them holds an Nginx reverse proxy, which i was going to set up to proxy the admin page of Pi-Hole. Unfortunately, I did not realize that the admin page is actually http://dockerhost/admin. I was just typing in http://dockerhost or http://dockerhost:port-number for the system I was going to proxy. Sadly, I had to RTFM to figure out that I needed to add /admin to the url.
My final problem was understanding what was going on in the logs. There is a repeating query of pi.hole in the logs. That is because the container will constantly query itself. I thought the container was locked up. When you combine the fact that I was using port 8080 (which did not render the Pi-Hole webpage correctly) with the constant query, it looked like a badly broken system. Nope, that's just what it would look like if you took a look at the activity of a brand new DNS server.
So, now I give it a 24 hour run to make sure it does not crash by itself, and then slowly migrate a few of my active systems over. The best test method for my environment is connecting gaming systems, workstations, and then full roll-out. I urge a slow roll-out to allow enough time to recognize issues in specific systems and gain an understanding of how to resolve them rather than trying to fix a hundred problems at once. This should also integrate nicely into Home Assistant.
Subscribe to:
Post Comments (Atom)
3d design for printing
I don't want to sound like an idiot. I really don't. I just lack the patience to learn Blender. It's not just because the nam...

-
One of the ideal outcomes of new technology is advancing automation. Setting a schedule for a device to follow and establishing triggers to...
-
The fun stuff you can do with smart home devices is generally reliant on having a smart home hub. You can set up scripts in your devices, o...
-
I don't want to sound like an idiot. I really don't. I just lack the patience to learn Blender. It's not just because the nam...
No comments:
Post a Comment