This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
computing:unbounddns [2024/11/01 03:59] – oemb1905 | computing:unbounddns [2025/04/04 03:23] (current) – oemb1905 | ||
---|---|---|---|
Line 18: | Line 18: | ||
In that file, enter something like the following, adjusting as necessary for your use-case. | In that file, enter something like the following, adjusting as necessary for your use-case. | ||
- | | + | |
+ | logfile: "/ | ||
+ | log-time-ascii: | ||
+ | use-syslog: yes | ||
+ | directory: "/ | ||
+ | username: unbound | ||
+ | tls-cert-bundle: | ||
+ | verbosity: 3 | ||
+ | interface: 0.0.0.0 | ||
+ | interface: ::0 | ||
+ | port: 5335 | ||
+ | do-ip4: yes | ||
+ | do-udp: yes | ||
+ | do-tcp: yes | ||
+ | module-config: | ||
+ | do-ip6: yes | ||
+ | prefer-ip6: no | ||
+ | harden-glue: | ||
+ | harden-dnssec-stripped: | ||
+ | use-caps-for-id: | ||
+ | edns-buffer-size: | ||
+ | prefetch: yes | ||
+ | num-threads: | ||
+ | msg-cache-slabs: | ||
+ | rrset-cache-slabs: | ||
+ | infra-cache-slabs: | ||
+ | key-cache-slabs: | ||
+ | rrset-cache-size: | ||
+ | msg-cache-size: | ||
+ | outgoing-range: | ||
+ | num-queries-per-thread: | ||
+ | infra-cache-numhosts: | ||
+ | #so-rcvbuf: 1m | ||
+ | #so-sndbuf: 2m | ||
+ | so-reuseport: | ||
+ | private-address: | ||
+ | private-address: | ||
+ | private-address: | ||
+ | private-address: | ||
+ | private-address: | ||
+ | private-address: | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | access-control: | ||
+ | access-control: | ||
+ | access-control: | ||
+ | access-control: | ||
+ | aggressive-nsec: | ||
+ | hide-identity: | ||
+ | hide-version: | ||
+ | cache-max-ttl: | ||
+ | cache-min-ttl: | ||
| | ||
+ | In my case, I prefer traditional rotated logs with rsyslog, so I do the following: | ||
+ | sudo apt install rsyslog | ||
+ | sudo nano / | ||
+ | <if $programname == ' | ||
+ | <& stop> | ||
+ | nano / | ||
+ | | ||
+ | In the log rotate file, enter the following: | ||
+ | |||
+ | / | ||
+ | daily | ||
+ | rotate 7 | ||
+ | missingok | ||
+ | create 0640 root adm | ||
+ | postrotate | ||
+ | / | ||
+ | endscript | ||
+ | } | ||
+ | |||
+ | Additionally, | ||
+ | |||
+ | systemctl disable --now unbound-resolvconf.service | ||
+ | sed -Ei ' | ||
+ | rm / | ||
+ | |||
+ | To make sure logs are working properly: | ||
+ | | ||
+ | nano / | ||
+ | </ | ||
+ | sudo apparmor_parser -r / | ||
+ | sudo service apparmor restart | ||
+ | sudo mkdir -p / | ||
+ | sudo touch / | ||
+ | sudo chown unbound / | ||
+ | | ||
+ | Enforce edns settings specified in config: | ||
+ | |||
+ | nano / | ||
+ | < | ||
+ | |||
+ | The last step is configuring the unbound server in the pihole GUI. Alternately, | ||
+ | |||
+ | server: | ||
+ | interface: 127.0.0.1 | ||
+ | cache-max-ttl: | ||
+ | cache-min-ttl: | ||
+ | num-threads: | ||
+ | msg-cache-slabs: | ||
+ | rrset-cache-slabs: | ||
+ | infra-cache-slabs: | ||
+ | key-cache-slabs: | ||
+ | rrset-cache-size: | ||
+ | msg-cache-size: | ||
+ | #prefetch: yes | ||
+ | harden-dnssec-stripped: | ||
+ | use-syslog: yes | ||
+ | aggressive-nsec: | ||
+ | hide-identity: | ||
+ | hide-version: | ||
+ | use-caps-for-id: | ||
+ | do-tcp: yes | ||
+ | do-udp: yes | ||
+ | |||
+ | Then, just add '' | ||
- | --- //[[webmaster@haacksnetworking.org|oemb1905]] | + | --- //[[alerts@haacksnetworking.org|oemb1905]] |