@@ -14,6 +14,8 @@ In this section, we break down the DNS architecture of the Homelab. The goal was
1414
1515<br >
1616
17+ ![ adguard-home] ( ../dns-adguard-unbound/adguard-home.png )
18+
1719## 1. Architecture Overview
1820
1921### The "Split-Brain" DNS Model
@@ -190,6 +192,144 @@ Create the Networks in Portainer
190192<br />
191193<br />
192194
195+
196+ ## Prepare Unbound Configuration
197+
198+ ``` bash
199+ sudo nano /docker/unbound/unbound.conf
200+ ```
201+
202+
203+ ``` bash
204+ server:
205+ # ##########################################################################
206+ # BASIC SETTINGS
207+ # ##########################################################################
208+ # Standard Port 53 (Mapped to 5053 via Docker Compose)
209+ interface: 0.0.0.0@53
210+ port: 53
211+
212+ # Protocol Support
213+ do-ip4: yes
214+ do-ip6: yes
215+ do-tcp: yes
216+ do-udp: yes
217+ prefer-ip6: no
218+
219+ # Optimization
220+ edns-buffer-size: 1232
221+ rrset-roundrobin: yes
222+ username: " _unbound"
223+
224+ # Directory
225+ directory: " /opt/unbound/etc/unbound"
226+ cache-max-ttl: 86400
227+ cache-min-ttl: 300
228+
229+ # ##########################################################################
230+ # LOGGING (Promtail Ready)
231+ # ##########################################################################
232+ # Disable internal file logging -> Send to Stdout for Docker/Promtail
233+ log-local-actions: no
234+ log-queries: no
235+ log-replies: no
236+ log-servfail: no
237+
238+ logfile: " " # Force stdout
239+ use-syslog: no
240+ verbosity: 2 # Level 2 gives us the stats we need for Grafana
241+
242+ # ##########################################################################
243+ # PERFORMANCE (Tuned for 8GB Raspberry Pi)
244+ # ##########################################################################
245+ # Use all 4 cores
246+ num-threads: 4
247+
248+ # Slabs (Must be power of 2)
249+ infra-cache-slabs: 4
250+ key-cache-slabs: 4
251+ msg-cache-slabs: 4
252+ rrset-cache-slabs: 4
253+
254+ # Cache Sizes (High Performance - Uses ~2GB RAM total)
255+ msg-cache-size: 256m
256+ rrset-cache-size: 512m
257+
258+ # TCP & Queries
259+ outgoing-range: 8192
260+ num-queries-per-thread: 4096
261+ incoming-num-tcp: 10
262+
263+ # Speed Tweaks
264+ minimal-responses: yes
265+ prefetch: yes
266+ prefetch-key: yes
267+ serve-expired: yes
268+ so-reuseport: yes
269+
270+ # ##########################################################################
271+ # SECURITY & PRIVACY
272+ # ##########################################################################
273+ # Access Control (Allow Local Network)
274+ access-control: 127.0.0.1/32 allow
275+ access-control: 192.168.0.0/16 allow
276+ access-control: 172.16.0.0/12 allow
277+ access-control: 10.0.0.0/8 allow
278+ access-control: fc00::/7 allow
279+ access-control: ::1/128 allow
280+
281+ # Privacy
282+ hide-identity: yes
283+ hide-version: yes
284+ identity: " DNS"
285+ http-user-agent: " DNS"
286+ qname-minimisation: yes
287+ aggressive-nsec: yes
288+
289+ # Hardening
290+ harden-algo-downgrade: yes
291+ harden-below-nxdomain: yes
292+ harden-dnssec-stripped: yes
293+ harden-glue: yes
294+ harden-large-queries: yes
295+ harden-short-bufsize: yes
296+ use-caps-for-id: yes
297+
298+ # Private Addresses (Rebinding Protection)
299+ private-address: 10.0.0.0/8
300+ private-address: 172.16.0.0/12
301+ private-address: 192.168.0.0/16
302+ private-address: 169.254.0.0/16
303+ private-address: fd00::/8
304+ private-address: fe80::/10
305+
306+ # Certificates
307+ tls-cert-bundle: /etc/ssl/certs/ca-certificates.crt
308+
309+ # ##########################################################################
310+ # INCLUDES
311+ # ##########################################################################
312+ # Only include custom conf files if you create them manually
313+ # include: "*.conf"
314+
315+ domain-insecure: " valoo.fi"
316+
317+ remote-control:
318+ control-enable: no
319+
320+
321+ # Forward Zone for Valoo (Bypass local validation)
322+ forward-zone:
323+ name: " valoo.fi"
324+ forward-dnssec: no
325+ forward-addr: 9.9.9.9
326+ forward-addr: 1.1.1.1
327+
328+ ```
329+
330+ <br />
331+ <br />
332+
193333## Unbound Portainer Stack
194334
195335``` yaml
@@ -227,9 +367,11 @@ services:
227367 restart : unless-stopped
228368` ` `
229369
370+
230371<br/>
231372<br/>
232373
374+
233375## Adguard Portainer Stack
234376
235377` ` ` yaml
0 commit comments