Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
user:gp68:unbound [2024-09-02T17:04:54Z] – [Refresh script] gp68 | user:gp68:unbound [2024-09-03T11:03:59Z] (current) – gp68 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Unbound Howto ====== | ====== Unbound Howto ====== | ||
+ | This setup is build as an example to work as tier1 or tier2 server. \\ | ||
+ | There is an update script which sets up all slave zones and does an tier1 anmd tiar2 server test after update. \\ | ||
+ | The update script also checks dnssec basics and updates the files in git. \\ | ||
+ | /// | ||
+ | |||
===== Base setup ===== | ===== Base setup ===== | ||
- | <code> | + | <file txt unbound.conf> |
server: | server: | ||
verbosity: 1 | verbosity: 1 | ||
Line 10: | Line 15: | ||
# ---------------------- | # ---------------------- | ||
# optimizations https:// | # optimizations https:// | ||
+ | # adjust for your needs | ||
# ---------------------- | # ---------------------- | ||
num-threads: | num-threads: | ||
Line 30: | Line 36: | ||
stream-wait-size: | stream-wait-size: | ||
# ---------------------- | # ---------------------- | ||
+ | # can be set to 0 if you don't need | ||
+ | # | ||
statistics-interval: | statistics-interval: | ||
# ---------------------- | # ---------------------- | ||
Line 42: | Line 50: | ||
tls-service-key: | tls-service-key: | ||
tls-service-pem: | tls-service-pem: | ||
- | # | + | # i don't like files :-) |
use-syslog: | use-syslog: | ||
- | # first start | + | # ------------------------------------- |
+ | # for the first start update files | ||
+ | # named.cache.opennic and opennic.dnskey | ||
+ | # manually | ||
+ | # ------------------------------------- | ||
# drill . ns @161.97.219.84 > named.cache.opennic | # drill . ns @161.97.219.84 > named.cache.opennic | ||
# dig -t DNSKEY . @161.97.219.84 | dnssec-dsfromkey -1 -f - . > opennic.dnskey | # dig -t DNSKEY . @161.97.219.84 | dnssec-dsfromkey -1 -f - . > opennic.dnskey | ||
Line 50: | Line 62: | ||
root-hints: | root-hints: | ||
trust-anchor-file: | trust-anchor-file: | ||
+ | # -------------------------------------------------- | ||
# dnssec not working at the moment for all domains | # dnssec not working at the moment for all domains | ||
+ | # -------------------------------------------------- | ||
harden-dnssec-stripped: | harden-dnssec-stripped: | ||
harden-glue: | harden-glue: | ||
- | aggressive-nsec: | + | aggressive-nsec: |
- | do-not-query-localhost: | + | # access control for everyone ai and ipv6 |
access-control: | access-control: | ||
access-control: | access-control: | ||
- | # | + | # no identity needed |
hide-identity: | hide-identity: | ||
identity: " | identity: " | ||
Line 63: | Line 77: | ||
version: | version: | ||
tls-system-cert: | tls-system-cert: | ||
+ | # DOS protection | ||
# | # | ||
# | # | ||
ratelimit: 100 | ratelimit: 100 | ||
+ | # --------------------------------------- | ||
+ | # for start make am empty file | ||
+ | # will be updated by refresh script | ||
+ | # | ||
include: / | include: / | ||
- | + | # | |
- | local-zone: " | + | # enable control via locahhost |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | local-zone: " | + | |
- | # test local | + | |
- | # just an example | + | |
- | # | + | |
- | # | + | |
- | # | + | |
remote-control: | remote-control: | ||
control-enable: | control-enable: | ||
- | + | ||
- | </code> | + | include: / |
+ | </file> | ||
===== Refresh script ===== | ===== Refresh script ===== | ||
+ | Gets the opennic root nameserver from the web | ||
- | <code> | + | <file perl getroot_opennic.pl> |
# | # | ||
Line 152: | Line 134: | ||
print $1 . " | print $1 . " | ||
} | } | ||
- | </code> | + | </file> |
+ | |||
+ | Refreshes the files | ||
+ | * opennic.dnskey | ||
+ | * named.cache.opennic | ||
+ | * opennic_server.conf | ||
+ | * opennic_domains.conf | ||
+ | |||
+ | The script locks for single usage and checks the serial of the root zone for changes. | ||
- | <code> | + | <file bash refresh_base.sh> |
#!/bin/bash | #!/bin/bash | ||
Line 341: | Line 331: | ||
sleep 10 | sleep 10 | ||
- | wget -q --no-check-certificate -O test.txt | + | wget -q --no-check-certificate -O test.txt |
if [ $(cat test.txt | perl -n -e 'if ( $p == 1 ) { /Passed/ && print " | if [ $(cat test.txt | perl -n -e 'if ( $p == 1 ) { /Passed/ && print " | ||
echo " | echo " | ||
Line 353: | Line 343: | ||
sleep 10 | sleep 10 | ||
- | wget -q --no-check-certificate -O test.txt | + | wget -q --no-check-certificate -O test.txt |
if [ $(cat test.txt | perl -n -e '/ | if [ $(cat test.txt | perl -n -e '/ | ||
echo " | echo " | ||
Line 371: | Line 361: | ||
git commit -am " | git commit -am " | ||
- | </code> | + | </file> |