Better to install Pi-Hole on router or switch/ RAM usage on Pi Zero


#1

Hello, on a network with two routers and a switch, it is better to connect pi hole on the switch or on the router or it’s the same?

Thank you


#2

It should not matter. As long as the Pi-Hole is on the same IP range and subnet as the rest of your network, and has a static IP address, it will work.


#3

My router is on 192.x.x.x range, and pi hole ad 10.x.x.x it’s not a problem ? If i use pi hole as dhcp and add the router ip


#4

Why does your Pi-hole have a different subnet than the rest of your network?


#5

It’s just the router, that have this IP and i don’t know if i need to change the router IP, or because it’s a router, i can keep this ip on my router


#6

The router and Pi-Hole need to be on the same address range. If your router range is 192.x.x.x, then the Pi-Hole needs to be 192.x.x.x or the router and Pi-Hole cannot communicate and the other devices connected to the router can’t communicate with the Pi.

Example - your router IP is 192.168.0.1. Then your Pi-Hole should have a static IP between 192.168.0.x, where x is an unused IP address in the range 2 to 254.


#7

Ah but I thought the router was able to communicate with several sub networks, it’s not his goal?

I deactivated the DHCP server of my router and activated the pi-hole using the same range, and I put the IP address of my router, but I did a leak test DNS and I saw that he was still using the DNS of my router.

I did some tests and I noticed that it was with the IPV6, for example in my NetworkManager if on the IPV6 tab I put “Automatic, DHCP only” there it blocks me all right, and when I was using my ISP router and I had just modified the IPV4 in NetworkManager by putting pi hole in DNS (192.168.1.X) without touching the IPV6 there blocking me anyway without DNS leakage, and without touching the IPV6,

On the other hand on my phone I also had ads even using pi-hole and my router in DHCP server, what can I do, I have to disable the IPV6 on the router?


#9

The router usually acts as a gateway and NAT so that your local devices can connect to the greater internet. Your local network seems to be on 192.168.1.X, so Pi-hole should have an address in that range.
When you change DHCP servers, you should restart devices so they get the new DHCP information.
Some routers, even when you turn off DHCP, still keep DHCPv6 running, which can be a nuisance. This is a router problem, which is out of scope for Pi-hole to try and fix itself.


#10

So i need to disable ipv6 ? I don’t know if it’s a good idea,

I have some problem with my pi zero as a dhcp server, maybe switch to another pi ?


#11

Why do think it’s not a good idea? If you don’t need or use IPV6, disabling it will not cause problems.

I don’t think will solve your problem. It’s not a Pi hardware issue, it’s a network configuration issue.


#12

A post was split to a new topic: Cannot get Pi-Hole to work


#13

I don’t know why, sometimes the DHCP server is very slow to give me an ip, the pi doesn’t respond, i have 400M used on the pi zero don’t know why


#14

DHCP servers do very little work. Once every lease period (usually a day), they hand out an IP address to a handful of clients.

I assume this is RAM used? On a Pi Zero with 512MB of RAM this could cause system slowness.

How many domains are on your blocklist, and what method of domain blocking do you use? To test domain blocking method, run dig flurry.com If this returns 0.0.0.0 it’s NULL blocking, if the IP of your Pi-Hole it’s IP blocking.


#15

I have disabled DHCP on my ISP router and enabled on pi-hole, i don’t know why i got blank pages and need to wait with pi-hole as a dhcp server

Yeah it’s IP blocking :
;; Query time: 2 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)


#16

If you have a large number of domains on your blocklists, this can eat up a lot of your RAM. Also, the blocking mode can significantly affect the RAM usage.

What is the full output of these commands:

dig flurry.com

echo ">stats" | nc localhost 4711


#17

; <<>> DiG 9.10.3-P4-Raspbian <<>> flurry.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4741
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;flurry.com. IN A

;; ANSWER SECTION:
flurry.com. 2 IN A 0.0.0.0

;; Query time: 2 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Sep 15 03:09:02 CEST 2018
;; MSG SIZE rcvd: 55

domains_being_blocked 2636003

dns_queries_today 10091
ads_blocked_today 3093
ads_percentage_today 30.651075
unique_domains 1012
queries_forwarded 3909
queries_cached 3089
clients_ever_seen 7
unique_clients 7
dns_queries_all_types 10135
reply_NODATA 554
reply_NXDOMAIN 30
reply_CNAME 764
reply_IP 2299
status enabled


#18

#19

When using Null blocking the memory usage is doubled because the table has to contain the IPv4 and the IPv6 entry.

This is not the case for NXDOMAIN

:zipper_mouth_face:


#20

So i need to upgrade to an pi 3 i think


#21

Do you have almost 2.64 million domains blocked?

If so, do you think that is efficient. I block 0.22 million domain and that already overkill.