OpenWrt Docker Pi-Hole ERROR

omg I'm so careless .. The container was up and running.
Continuing the Test step.

root@OpenWrt:~/pihole/etc-cont-init.d# ping 192.168.1.3
PING 192.168.1.3 (192.168.1.3): 56 data bytes
64 bytes from 192.168.1.3: seq=0 ttl=64 time=0.354 ms
64 bytes from 192.168.1.3: seq=1 ttl=64 time=0.309 ms
64 bytes from 192.168.1.3: seq=2 ttl=64 time=0.281 ms
^C
--- 192.168.1.3 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.281/0.314/0.354 ms

root@OpenWrt:~/pihole/etc-cont-init.d# nslookup openwrt.org 192.168.1.3
Server:         192.168.1.3
Address:        192.168.1.3#53

Name:      openwrt.org
Address 1: 139.59.209.225
Address 2: 2a03:b0c0:3:d0::1af1:1

root@OpenWrt:~/pihole/etc-cont-init.d# nslookup $root.lan 192.168.1.3
;; connection timed out; no servers could be reached

the http://192.168.1.3/admin can be opened now and i already do the Configure DNS settings in OpenWrt and Profit! steps .. now its the nslookup $root.lan 192.168.1.3 problem. the setupVars already use REV_SERVER_TARGET=127.0.0.11

root@OpenWrt:~/pihole/etc-pihole# cat setupVars.conf
PIHOLE_DNS_1=8.8.8.8
PIHOLE_DNS_2=8.8.4.4
WEBPASSWORD=8b01a591f113a0751eda4062f8176b72d72e4a28c77077fcc4c0a018150cf1d4
BLOCKING_ENABLED=true

REV_SERVER=true
REV_SERVER_CIDR=192.168.1.0/24
REV_SERVER_TARGET=127.0.0.11
REV_SERVER_DOMAIN=lan
INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true
PIHOLE_INTERFACE=eth0
QUERY_LOGGING=true

The OpenWrt can ping 8.8.8.8 and google but my PC that connected to the Raspberry Pi by Lan Cable didnt get Internet Connection on the ethernet connection ..

Yet again, that's great news! You've managed to fully set it up and have it running!

The command should have been nslookup $(hostname).lan 192.168.1.3, why are you trying with $root instead?

Can you try the following from the PC and share the output:

ping 8.8.8.8
prig 192.168.1.3
nslookup openwrt.org 8.8.8.8
nslookup openwrt.org 192.168.1.3

Careful that's the (I think?) hashed password to you PiHole, might consider changing it and not sharing it on the Internet.

The reason why my PC didn't get the internet via ethernet that connected to raspy and OpenWrt because I already did the Configure DNS settings in OpenWrt and Profit! steps from your post. When I delete the list dhcp_option '6,192.168.1.3' from the /etc/config/dhcp it works again now.

I didn't get it what to put in the (hostname) line so I just using root(Forgive me im stil newbie in this IT world). What should I use because the openwrt said ..

root@OpenWrt:~# nslookup $(hostname).lan 192.168.1.3
-ash: hostname: not found
;; connection timed out; no servers could be reached

Here is the output of the list command from my PC

C:\Users\Asus>ping 192.168.1.3

Pinging 192.168.1.3 with 32 bytes of data:
Reply from 192.168.1.3: bytes=32 time<1ms TTL=63
Reply from 192.168.1.3: bytes=32 time<1ms TTL=63
Reply from 192.168.1.3: bytes=32 time<1ms TTL=63
Reply from 192.168.1.3: bytes=32 time<1ms TTL=63

Ping statistics for 192.168.1.3:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Users\Asus>nslookup openwrt.org 8.8.8.8
Server:  dns.google
Address:  8.8.8.8

Non-authoritative answer:
Name:    openwrt.org
Address:  139.59.209.225


C:\Users\Asus>nslookup openwrt.org 192.168.1.3
Server:  pi.hole
Address:  192.168.1.3

Non-authoritative answer:
Name:    openwrt.org
Addresses:  2a03:b0c0:3:d0::1af1:1
          139.59.209.225

No problem this is still my development test and I will change it later on production phase..

1 Like

Shocking! I'm the one who needs to be forgiven, for mistakenly thinking there is a hostname command pre-installed in OpenWrt (thinking it being just another Linux distro clearly showed me I am wrong!). Never mind the nslookup $(hostname).lan 192.168.1.3. Try nslookup openwrt.lan 192.168.1.3 instead, should work and give the IP address 192.168.1.1.

The whole idea of $(hostname) was the shell to automatically replace it with openwrt, but since hostname command doesn't exist, that's why it didn't work. My mistake and will fix the tutorial.

Ok this is going to be a bit tricky, but you need to have dhcp_option '6,192.168.1.3' in /etc/config/dhcp, because if you don't then you won't be using PiHole and instead will use the default DNS 192.168.1.1 which means no ad-blocking, that's not our goal.

Add it again and run /etc/init.d/dhcp restart on RPi, then on your Asus laptop, disconnect the ethernet and then re-connect it (make sure WiFi is off so we don't get confused). Then run the following command on your Asus: nslookup openwrt.org and share the output. Try opening openwrt.org on your Asus browser and share a screenshot of the error if it's still not working.

Is thish the right output ?

root@OpenWrt:~# nslookup openwrt.lan 192.168.1.3
Server:         192.168.1.3
Address:        192.168.1.3#53

Name:      openwrt.lan
Address 1: 10.20.30.40
Address 2: fd13:86c8:6cff::1

Add the dhcp_option '6,192.168.1.3' in /etc/config/dhcp > reboot > turn off wifi reconnect the Laptop via Ethernet to Raspy > Run command nslookup openwrt.org..

C:\Users\Asus>nslookup openwrt.org
Server:  OpenWrt.lan
Address:  fd13:86c8:6cff::1

Non-authoritative answer:
Name:    openwrt.org
Address:  139.59.209.225

I already check the DNS of my laptop and yes it is using 192.168.1.3 .. but I try opening some news website the ads didn't got block, I try removing all the data clear history, cache, and etc reopening the website but it didn;t got block .. I alreadt try PiHole before running at ubuntu desktop using vmware it did work blocking the ads .. is there configuration I miss or the OpenWrt slip up other DNS server so the Ads still show up ?

DNS Servers . . . . . . . . . . . : fd13:86c8:6cff::1
                                       192.168.1.3
                                       fd13:86c8:6cff::1

result DNS server on my Laptop

I honestly did not consider IPv6 in this tutorial, in my setup I have disabled IPv6 in OpenWrt so my entire LAN is just using IPv4. Is IPv6 important to you? If not let's disable it temporarily on your Asus and try again. Follow the steps in below link, do it on the Ethernet Adapter instead of the WiFi adapter. Also there is no need to restart your computer, just disconnect and reconnect the Ethernet cable.
https://answers.uillinois.edu/uis/page.php?id=99981

Look at the output of the DNS servers you have, there are three! One is the PiHole which is in the middle, but the other two are the OpenWrt IPv6 default DNS server (which doesn't block ads). Guess what, your Asus is most probably using the IPv6 instead of IPv4, so that's why the ads are not blocked.

I don't know what's going on but here is what happen..
After disabling IPv6 on Ethernet it does gave my laptop only Pi-Hole address

DNS Servers . . . . . . . . . . . : 192.168.1.3

WhatsApp Image 2022-04-13 at 1.40.29 PM

But I cant connect to the Internet ping 8.8.8.8 does work but ping google don't

C:\Users\Asus>ping google.com
Ping request could not find host google.com. Please check the name and try again.

So I check the Pi-Hole container ..

root@OpenWrt:~# docker exec -it pihole ping google.com
PING forcesafesearch.google.com (216.239.38.120) 56(84) bytes of data.
64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=1 ttl=115 time=16.0 ms
64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=2 ttl=115 time=18.6 ms
64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=3 ttl=115 time=19.3 ms
64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=4 ttl=115 time=19.3 ms
64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=5 ttl=115 time=15.4 ms
^C
--- forcesafesearch.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 11ms
rtt min/avg/max/mdev = 15.437/17.717/19.287/1.658 ms

What happen now ?

Try the following first from your Asus and share the output with me please, make sure that pihole container is running:

ping 192.168.1.3
nslookup google.com 192.168.1.3
nslookup google.com 8.8.8.8
nslookup google.com
ipconfig /all

Remember that in your post here the commands were working just fine so I expect the commands above commands should still be working unless something has changed:

Thank you so much, everything works now its just some firewall setting I try that make DNS isn't responding after I disabled that setting everything works fine now. The OpenWrt gave IP address of Pi-Hole as DNS and the ads got block.
Once again thanks for helping..

That's great news, congrats and most welcome!

If you have a moment to mark your topic as solved for the others to know, that would be great. Thanks for your efforts!

1 Like

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