diff --git a/docs/images/conditional-forwarding.png b/docs/images/conditional-forwarding.png new file mode 100644 index 0000000..27e7eeb Binary files /dev/null and b/docs/images/conditional-forwarding.png differ diff --git a/docs/images/fritzbox-advanced-de.png b/docs/images/fritzbox-advanced-de.png new file mode 100644 index 0000000..de6b62c Binary files /dev/null and b/docs/images/fritzbox-advanced-de.png differ diff --git a/docs/images/fritzbox-advanced.png b/docs/images/fritzbox-advanced.png new file mode 100644 index 0000000..d089157 Binary files /dev/null and b/docs/images/fritzbox-advanced.png differ diff --git a/docs/images/fritzbox-dhcp-de.png b/docs/images/fritzbox-dhcp-de.png new file mode 100644 index 0000000..91a9600 Binary files /dev/null and b/docs/images/fritzbox-dhcp-de.png differ diff --git a/docs/images/fritzbox-dhcp.png b/docs/images/fritzbox-dhcp.png new file mode 100644 index 0000000..72235b5 Binary files /dev/null and b/docs/images/fritzbox-dhcp.png differ diff --git a/docs/images/fritzbox-wan-dns-de.png b/docs/images/fritzbox-wan-dns-de.png new file mode 100644 index 0000000..dba59f9 Binary files /dev/null and b/docs/images/fritzbox-wan-dns-de.png differ diff --git a/docs/images/fritzbox-wan-dns.png b/docs/images/fritzbox-wan-dns.png new file mode 100644 index 0000000..2f04d4d Binary files /dev/null and b/docs/images/fritzbox-wan-dns.png differ diff --git a/docs/routers/fritzbox-de.md b/docs/routers/fritzbox-de.md new file mode 100644 index 0000000..97d3f26 --- /dev/null +++ b/docs/routers/fritzbox-de.md @@ -0,0 +1,92 @@ +Diese Anleitung wurde für FRITZ!OS 07.21 geschrieben, sollte jedoch auch mit anderen Firmware-Versionen funktionieren. Ziel ist es, grundlegende Prinzipien für ein reibungsloses Zusammenspiel zwischen Fritz!Box und Pi-hole zu verdeutlichen. + +> Hinweis: +Es gibt nicht nur **die eine Art**, eine funktionierende DNS System aufzusetzen. Konfiguriert euer Netzwerk nach euren Bedürfnissen. +Diese Anleitung wurde für IPv4 geschrieben und muss für IPv6 Netwerke entsprechend angepasst werden. + +### Erweiterte Ansicht aktivieren + +Einige dieser Einstellungen sind nur sichtbar, wenn voher die Ansicht auf "Erweitert" gesetzt wurde. Diese wird durch Umschalten (Klick) auf "Standard" am unteren linken Bildrand aktiviert. + +![Screenshot der Fritz!Box DHCP Einstellungen](../images/fritzbox-advanced-de.png) + +## Pi-hole als DNS Server via DHCP an Clients verteilen (LAN Seite) + +Mit dieser Konfiguration wird allen Clients die IP des Pi-hole als DNS Server angeboten, wenn sie einen DHCP Lease von der Fritz!Box anfordern. +DNS Anfragen nehmen folgenden Weg + +```bash +Client -> Pi-hole -> Upstream DNS Server +``` + +> Hinweis: +Die Fritz!Box selbst wird den unter Internet/Zugangsdaten/DNS-Server eingestellten DNS Server nutzen (siehe unten). +Die Fritz!Box kann der Upstream Server von Pi-hole sein, solange Pi-hole nicht der Upstream Server der Fritz!Box ist. Dies würde zu einem DNS Loop führen. + +Um diese Konfiguration zu nutzen, muss die IP des Pi-hole als "Lokaler DNS-Server" in + +```bash +Heimnetz/Netzwerk/Netzwerkeinstellungen/IP-Adressen/IPv4-Konfiguration/Heimnetz +``` + +eingetragen werden. + +![Screenshot der Fritz!Box DHCP Einstellungen](../images/fritzbox-dhcp-de.png) + +>Hinweis: +Clients bemerken Änderungen an den DHCP Einstellungen erst, wenn der DHCP Lease erneuert wird. Der einfachste Weg dies zu erzwingen ist ein Unterbrechen und Wiederherstellen der Netzwerkverbindung. + +Nun sollten einzelne Clients in Pi-hole Dashboard auftrauchen. + +## Pi-hole als Upstream DNS Server der Fritz!Box (WAN Seite) + +Mit dieser Konfiguration wird Pi-hole auch von der Fritz!Box selbst als Upstream DNS Server genutzt. DNS Anfragen nehmen folgenden Weg + +```bash +(Clients) -> Fritz!Box -> Pi-hole -> Upstream DNS Server +``` + +Zum Einstellen muss die IP des Pi-hole als "Bevorzugter DNSv4-Server" **und** "Alternativer DNSv4-Server" in + +```bash +Internet/Zugangsdaten/DNS-Server +``` + +eingetragen werden. + +![Screenshot der Fritz!Box WAN DNS Konfiguration](../images/fritzbox-wan-dns-de.png) + +!!! warning + Die Fritz!Box darf mit dieser Konfiguration nicht als Upstream DNS Server im Pi-hole eingestellt werden. Dies würde zu einem DNS Loop führen, da Pi-hole dann die Anfragen an die Fritz!Box senden würde, welche sie wiederum an Pi-hole senden würde. + +Wird ausschließlich diese Konfiguration genutz, sind im Pi-hole Dashboard keine individuellen Clients sichtbar. Für Pi-hole scheinen alle Anfragen von der Fritz!Box zu kommen. Dadurch können nicht alle Funktionen von Pi-hole genutzt werden, z.B. die Möglichkeit, Clients individuell zu filtern (Group Management). Wenn dies gewünscht ist, muss Pi-hole (zusätzlich) als DNS Server via DHCP an die Clients verteilt werden (siehe oben). + +### Pi-hole im Gastnetzwerk nutzen + +Es gibt in der Fritz!Box keine Möglichkeit unter + +```bash +Heimnetz/Netzwerk/Netzwerkeinstellungen/IP-Adressen/IPv4-Konfiguration/Gastnetz +``` + +den DNS Server des Gastnetzwerks einzustellen. + +Die Fritz!Box wird immer ihre eigene IP als DNS Server des Gastnetzes einstellen. Um die DNS Anfragen dennoch über den Pi-hole zu senden, muss dieser als Upstream DNS Server für die Fritz!Box eingetragen werden. Da es keine andere Option gibt, werden alle Anfragen aus dem Gastnetz für Pi-hole so erscheinen, als ob sie direkt von der Fritz!Box kommen. Eine individuelle Filterung je nach Client innerhalb des Gastnetzwerks ist deshalb nicht möglich. + +## Hostnamen in Pi-hole statt IP-Addressen - Conditional forwarding + +Wenn die Fritz!Box im Netzwerk als DHCP Server fungiert, werden die Hostnamen der Clients nur dort registriert. Pi-hole versucht standardmäßig, die IP-Adressen der Clients wieder in Hostnamen aufzulösen. Daher müssen die Anfragen zur Fritz!Box gelangen. +Dafür gibt es zwei Wege: + +* Die Fritz!Box ist der Upstream DNS Server des Pi-holes. Damit landen alle Anfragen sowieso bei der Fritz!Box, welche die Hostnamen an Pi-hole zurücksenden kann. + +!!! warning + Die Fritz!Box darf nur der Upstream DNS Server des Pi-hole sein, wenn dieser nicht gleichzeitig der Upstream DNS Server der Fritz!Box ist. Dies würde zu einem DNS Loop führen. + +* Es werden nur die Anfragen an die Fritz!Box gesendet, welche versuchen im lokalen Netzwerk IP-Adressen wieder Hostnamen zuzuordnene. Alle anderen Anfragen werden an den Upstream DNS Server des Pi-Hole gesendet. Dafür ist die Option *Conditional forwarding* zuständig. +Folgende Einstellungen müssen dafür vorgenommen werden: + * **Local network in CIDR notation:** IP-Bereich des Netzwerks in CIDR Notation, Standard für die Fritz!Box ist **192.168.178.0/24** + * **IP address of your DHCP server (router):** IP-Adresse der Fritz!Box selbst, Standard ist **192.168.178.1** + * **Local domain name (optional):** Name der lokalen Domän, für die Fritz!Box **fritz.box** + +![Screenshot der Conditional Forwarding Einstellungen](../images/conditional-forwarding.png) diff --git a/docs/routers/fritzbox.md b/docs/routers/fritzbox.md new file mode 100644 index 0000000..65093d4 --- /dev/null +++ b/docs/routers/fritzbox.md @@ -0,0 +1,88 @@ +This guide was developed using FRITZ!OS 07.21 but should work for others too. It aims to line out a few basic principles to have a seamless DNS experience with Pi-hole and Fritz!Boxes. + +> Note: +There is no single way to do it right. Choose the one best fitting your needs. +This guide is IPv4 only. You need to adjust for IPv6 accordingly. + +### Enable advanced settings + +Some of the the follwowing settings might be visible only if advanced settings are enabled. Therefore, "View" has to be changed to advanced by clicking on "Standard" in the lower left corner. + +![Screenshot der Fritz!Box DHCP Einstellungen](../images/fritzbox-advanced.png) + +## Distribute Pi-hole as DNS server via DHCP + +Using this configuration, all clients will get Pi-hole's IP offered as DNS server when they request a DHCP lease from your Fritz!Box. +DNS queries take the following path + +```bash +Client -> Pi-hole -> Upstream DNS Server +``` + +> Note: +The Fritz!Box itself will use whatever is configured in Internet/Account Information/DNS server (see below). +The Fritz!Box can be Pi-hole's upstream DNS server, as long Pi-hole itself is not the upstream server of the Fritz!Box. This would cause a DNS loop. + +To set it up, enter Pi-hole's IP as "Local DNS server" in + +```bash +Home Network/Network/Network Settings/IP Adresses/IPv4 Configuration/Home Network +``` + +![Screenshot of Fritz!Box DHCP Settings](../images/fritzbox-dhcp.png) + +>Note: +Clients will notice changes in DHCP settings only after they acquired a new DHCP lease. The easiest way to force a renewal is to dis/reconnect the client from the network. + +Now you should see individual clients in Pi-hole's web dashboard. + + +## Pi-hole as upstream DNS server for your Fritz!Box + +With this configuration, Pi-hole is also used by the Fritz!Box itself as an upstream DNS server. DNS queries take the following path + +```bash +(Clients) -> Fritz!Box -> Pi-hole -> Upstream DNS Server +``` + +To set it up, enter Pi-hole's IP as "Preferred DNSv4 server" **and** "Alternative DNSv4 server" in + +```bash +Internet/Account Information/DNS server +``` + +![Screenshot of Fritz!Box WAN DNS Configuration](../images/fritzbox-wan-dns.png) + +!!! warning + Don't set the Fitz!Box as upstrem DNS server for Pi-hole if using this configuration! This will lead to a DNS loop as the Pi-hole will send the queries to the Fritz!Box which in turn will send them to Pi-hole. + +If only this configuration is used, you won't see individual clients in Pi-hole's dashboard. For Pi-hole, all queries will appear as if they are coming from your Fritz!Box. You will therefore miss out on some features, e.g. Group Management. If you want to use them, Pi-hole must (additionally) be distributed to the clients as DNS server via DHCP (see above). + +### Using Pi-hole within the Guest Network + +There is no option to set the DNS server for the guest network in + +```bash +Home Network/Network/Network Settings/IP Adresses/IPv4 Configuration/Guest Network +``` + +The Fritz!Box always sets its own IP as DNS server for the guest network. To filter its traffic, you have to setup Pi-hole as upstream DNS server for your Fritz!Box. As there is no other option, all DNS requests from your guest network will appear as coming from your Fritz!Box. Individual filtering per client within the guest network is therefore not possible. + +## Hostnames instead of IP addresses in Pi-hole's web interface - Conditional forwarding + +In case the Fritz!Box is used as DHCP server, client's hostames are registered only there. By default, Pi-hole tries to resolve the IP addresses of the clients back into host names. Therefore, the requests must reach the Fritz!Box. +There are two ways to do this: + +* The Fritz!Box is the upstream DNS server of the Pi-hole. This means that all queries end up with the Fritz!Box anyway, which can send the host names back to Pi-hole. + +!!! warning + The Fritz!Box may only be the upstream DNS server of the Pi-hole if Pi-hole is not the upstream DNS server of the Fritz!Box. This would lead to a DNS loop. + +* Only those queries are sent to the Fritz!Box that attempt to determine hostnames for IP addresses (clients) of the local network. All other requests are sent to the upstream DNS server of the Pi-Hole. The *Conditional forwarding* option is responsible for this. +The following settings must be made: + * **Local network in CIDR notation:** Standard IP range of the Fritz!Box is **192.168.178.0/24** + * **IP address of your DHCP server (router):** IP of the Fritz!Box, standard is **192.168.178.1** + * **Local domain name (optional):** Fritz!Box uses **fritz.box** + +![Screenshot der Conditional Forwarding Einstellungen](../images/conditional-forwarding.png) + diff --git a/mkdocs.yml b/mkdocs.yml index 32af216..5efd672 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -118,6 +118,9 @@ nav: - 'Using Tor': guides/tor/using-tor.md - 'Performance and other issues': guides/tor/performance-issues.md - 'Using DNSSEC': guides/tor/dnssec.md + - 'Router setup': + - 'Fritz!Box (EN)': routers/fritzbox.md + - 'Fritz!Box (DE)': routers/fritzbox-de.md - 'Community Projects': main/projects.md extra: