Setting up Pi-hole

Soldato
Joined
17 May 2013
Posts
2,600
Location
West Sussex, UK
I am really struggling to get this working via an Unraid docker.

I can't resolve and DNS names, I can ping the Docker container IP but not browse any website.

Has the container got access to the internet?

Click the docker icon, open console. Type
curl ifconfig.me
. It should show you the external IP address of the docker.

I've no experience of it in a container environment, I kept it simple and used a RPi
 
Soldato
Joined
5 Jun 2010
Posts
15,459
Has the container got access to the internet?

Click the docker icon, open console. Type . It should show you the external IP address of the docker.

I've no experience of it in a container environment, I kept it simple and used a RPi

Code:
[email protected]:/# curl ifconfig.me
curl: (7) Failed to connect to ifconfig.me port 80: No route to host
[email protected]:/#

That is what it returned.
 
Soldato
Joined
5 Jun 2010
Posts
15,459
These are the current settings.

R3W8Kyt.png
 
Caporegime
Joined
20 Sep 2006
Posts
28,006
So set them to Open DNS for example?
I don't know PiHole that well but I would have thought you get the option during configuration, or it'll put in a default one. AdGuard as an example has a preconfigured DNS forwarder.
 
Soldato
Joined
5 Jun 2010
Posts
15,459
These are the DNS settings.

DGdgSiT.png


I think the fundamental issue is I can't ping the outside world from within the Docker container console.

I can ping the outside world from the Unraid console.
 
Associate
Joined
4 Dec 2009
Posts
493
These are the DNS settings.

DGdgSiT.png


I think the fundamental issue is I can't ping the outside world from within the Docker container console.

I can ping the outside world from the Unraid console.
On this screen the tick box at the bottom should be unticked, then tick the next one.
This will set google as resolver1 and cloudflare as reoslver2 (for IP4).
Pihole usese a combination of 2 resolvers as (among other things) a load balancing measure. It will randomly choose to use your 2nd resolver even if the 1st one is fine.
The GUI above isnt very clear but column 1 is resolver 1 (which you have set twice) and column2 is resolver 2.
There are then also 2 resolvers for IPv6 and you have nothing set for either of those.
You can then further expand on this. by using the 4 boxes on the right to set your own resolvers.
Again 2 for IP4 and 2 for IP6.
 
Associate
Joined
13 Jun 2016
Posts
1,293
Location
UK
I agree with @MonkeyBasher - looks like the DNS settings within the application itself are set wrong. Here's mine as an example:

Screenshot-20220107-173946.png


You also need to have the IP addresses for the DNS servers passed via the Docker container config - in my setup they are set to use the Cloudflare DNS servers:

Screenshot-20220107-174523.png


I expect if you were to go to the Unraid Docker page, click on the menu for PiHole and instead of choosing 'WebUI' choose 'Console' and then try pinging something, that you would find you don't have a connection/can't resolve DNS outside your network.
 
Soldato
Joined
11 May 2007
Posts
8,545
Location
Surrey
Any ideas how I fix this?

'not giving name localhost.lan to the DHCP lease of 192.168.1.147 because the name exists in /etc/hosts with address 127.0.0.1'

Documentation doesn't really elude to what I need to do. I'm guessing I need to SSH in and change something in the hosts rather than through the GUI?
 
Soldato
Joined
24 Sep 2015
Posts
3,144
SSH into the Pi-Hole and do 'cat /etc/hosts' and then post the contents here. Mine for comparison:
Code:
[[email protected] ~]# cat /etc/hosts
127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1       pihole1
[[email protected] ~]


I expect there's a line in yours that says:
Code:
127.0.0.1       localhost.lan


Delete that line.

Alternatively, change the hostname of that device that's seemingly having trouble getting an IP address.
 
Top Bottom