Forcing Pi-hole routing

Started by kosta, February 20, 2021, 10:21:07 AM

Previous topic - Next topic
February 20, 2021, 10:21:07 AM Last Edit: February 20, 2021, 10:28:33 AM by kosta
Hello,
is it realistic to think I can force any DNS traffic in my network through the Pi-hole? Even if some machine decides, for to me unknown reason, to contact google DNS, which is what is happening right now (my docker container VM), I think I'd like it to go to the Pi-hole.

So I created these rules (see screenshots). Basically trying to move everything to the Pi-hole.

Of course, clients have Pi-hole set as DNS. However, I still get these google-dns leaks.

Should this work?

(how do I embed the screenshots into the post?)

The answer is yes you can force DNS to use the pihole. Have a look in the Tutorials and FAQs sub forum for setup instructions

https://forum.opnsense.org/index.php?topic=21196.0

This is what I already found. Nothing more.
While this is somewhat similar to what I did with the basic setup (basically solving the other problem I had, which is routing to my company domain), it doesn't cover what I asked here.
I would like to re-route all requests that go out to any other DNS server through the Pi-hole. Basically not allow any DNS requests to google and co, but force them through Pi-hole.
I've read some other posts outside of Tutorials section, that gave me the idea to do what I did, but it doesn't work. So yes, my two questions are, again:
- is it possible?
- what is wrong with my setup? (the packets are blocked, rather than re-routed)

Ich glaube du bist im falschen Bereich, hier wird deutsch geschrieben


Gesendet von iPad mit Tapatalk Pro
Internet: Willy.tel Down: 1Gbit/s, UP: 250Mbit/s Glasfaser  |
Router/Firewall: pfSense+ 23.09  |
Hardware: Netgate 6100

Whoops. So schnell irrt man sich, sorry. Das passiert halt wenn man kreuz und quer über Foren, Tutorials, Programme surft und ließt... ich kann beide Sprache eigentlich recht gut, daher irre ich mich aber auch oft ;-)

Aber ich ziehe die Aussage von vorher: es scheint doch zu funktioniere. Aktuell gibt es im Live Log keine Port 53 Meldungen die woanders hingehen als zum Pi-Hole, soweit ich sehen kann:
dstport=53 dst!=192.168.110.201 interface_name!=Loopback interface_name!=WAN

Ah sch... doch nicht. Wieder geht mein Docker-Server auf google raus. Auch wenn statisch eingestellt.

Wieso hast du bei deiner Portweiterleitung als Ziel deinen Pihole eingestellt?
Das Ziel muss ja ANY sein um ungewollte DNS Anfragen an den Pihole zu leiten
(Unoffial Community) OPNsense Telegram Group: https://t.me/joinchat/0o9JuLUXRFpiNmJk

PM for paid support

Das obige habe ich komplett zurückgestellt, da hier eine andere Anleitung vorhanden ist. Sozusagen neu angefangen.
Ziel ist: ! pi_hole, was heißt alles andere als Pi_hole.

Du möchtest ja das alle ausgehenden DNS Anfragen über deinen Pihole gehen.

Dazu erstellt du eine Portweiterleitung auf der LAN Schnittstelle

Quelle: LAN Network
Ziel : ANY (da du ja alle IPs abdecken musst 8.8.8.8, 1.1.1.1, ....)
Ziel Port: 53
Umleitungs IP: Pihole


Aktuell hast du ja bei Ziel deinen Pihole hinterlegt, bedeutet alle DNS Pakete die sowieso an den Pihole gehen werden dahin geleitet, also überflüssig.
Außerdem dürfte da eh nichts laufen, da dein pihole ja im gleichen Netzwerk ist
(Unoffial Community) OPNsense Telegram Group: https://t.me/joinchat/0o9JuLUXRFpiNmJk

PM for paid support

February 20, 2021, 01:58:32 PM #10 Last Edit: February 20, 2021, 02:00:09 PM by kosta
Ja, und das ist es eh schon durch das "!" (Invert), oder?
Pi ist im VLAN110, Rechner sind im LAN. Aber das macht nix aus, normalerweise, da das Routing gut funktioniert.
Außer, der Docker Server ist im gleichen VLAN wie Pi.

Nehme es zurück
Hast Recht,.

Habe das ! übersehen
(Unoffial Community) OPNsense Telegram Group: https://t.me/joinchat/0o9JuLUXRFpiNmJk

PM for paid support

Vermute ehr, dass die Pakete in den Logs angezeigt werden, da die Portweiterleitung erst danach greift.

Funktioniert DNS auf den Geräten denn ?
(Unoffial Community) OPNsense Telegram Group: https://t.me/joinchat/0o9JuLUXRFpiNmJk

PM for paid support

Ist vom Rule unabhängig, mit oder ohne, geht's. Denn die "normalen" Pakete, die über Pi gehen, ja auch rausgehen. Die Anfragen kommen von irgendwo, eigentlich keine Ahnung von wo. Vielleicht muss ein tcpdump troubleshooting am Docker Server machen um das rauszufinden. Es kann durchaus auch ein Docker sein, obwohl sie alle auf bridge einstellt sind.

Dann funktioniert also deine Portweiterleitung

Solange du dann eine Block rule für andere DNS Server hast klappt es ja

Also alles richtig
(Unoffial Community) OPNsense Telegram Group: https://t.me/joinchat/0o9JuLUXRFpiNmJk

PM for paid support