Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
linux:bind [2006/08/21 16:17] a Chrooted BIND9 in Debian |
linux:bind [2015/08/12 14:46] (current) zagi |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== BIND (is there anyting else?) ====== | ====== BIND (is there anyting else?) ====== | ||
| - | **Speedup tips** | + | ==== DNSSEC ==== |
| - | | + | |
| - | | + | |
| - | > But Now, in contrary the local dns is slower than a custom DNS by my | + | |
| - | > webhoster :-( | + | |
| - | + | ||
| - | You should use BIND 9, disable lookups over IPv6 (OPTIONS=" | + | |
| - | in / | + | |
| - | cache has been filled. | + | |
| - | ===== Chrooting BIND9 in Sarge ===== | + | copy generated files in / |
| - | | + | if you put your keys in / |
| - | For security reasons we want to run BIND chrooted so we have to do the following steps: | ||
| - | / | + | put this in zone domena.org |
| - | Edit the file '' | + | inline-signing yes; |
| + | auto-dnssec maintain; | ||
| + | key-directory "/etc/bind/keys/domena.org"; | ||
| + | sig-validity-interval 3; | ||
| - | | + | use dnssec-dsfromkey to create DS DNS records from **KSK files.** |
| - | Create the necessary directories under ''/ | ||
| - | mkdir -p / | + | To enable add to bind.named.options:\\ |
| - | mkdir / | + | |
| - | mkdir -p / | + | |
| - | mkdir -p /var/lib/named/ | + | |
| - | Then move the config directory from ''/ | ||
| - | mv /etc/bind / | + | dnssec-validation auto; |
| + | dnssec-enable yes; | ||
| + | dnssec-lookaside auto; | ||
| - | Create a symlink to the new config directory from the old location (to avoid problems when bind is upgraded in the future): | + | Add DS records at your domain registrar! |
| - | ln -s / | ||
| - | Make null and random devices, and fix permissions of the directories: | + | check your domain with http:// |
| - | mknod / | ||
| - | mknod / | ||
| - | chmod 666 / | ||
| - | chown -R bind:bind / | ||
| - | chown -R bind:bind / | ||
| - | We need to modify the startup script '' | + | https://www.dns-oarc.net/files/odvr/configs/bind/trusted-keys.conf\\ |
| + | \\ | ||
| + | logging {\\ | ||
| + | ...\\ | ||
| + | category dnssec { null;};};\\ | ||
| - | #! /bin/sh | ||
| - | # / | ||
| - | |||
| - | | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | test -x $binpath || exit 0 | ||
| - | |||
| - | # Options for start/ | ||
| - | # | ||
| - | # | ||
| - | | ||
| - | | + | ==== Letting bind/named query a specific DNS server for only one specific domain ==== |
| - | { | + | |
| - | if [ ! -e / | + | |
| - | mknod -m 640 / | + | |
| - | | + | |
| - | chmod 0640 / | + | |
| - | fi | + | |
| - | chown root:adm / | + | |
| - | } | + | |
| - | + | ||
| - | | + | |
| - | { | + | |
| - | # No pidfile, probably no daemon present | + | |
| - | # | + | |
| - | if [ ! -f $pidfile ] | + | |
| - | | + | |
| - | | + | |
| - | fi | + | |
| - | + | ||
| - | pid=`cat $pidfile` | + | |
| - | + | ||
| - | # No pid, probably no daemon present | + | |
| - | # | + | |
| - | if [ -z " | + | |
| - | | + | |
| - | return 1 | + | |
| - | fi | + | |
| - | + | ||
| - | if [ ! -d /proc/$pid ] | + | |
| - | | + | |
| - | | + | |
| - | fi | + | |
| - | + | ||
| - | cmd=`cat /proc/ | + | |
| - | + | ||
| - | # No syslogd? | + | |
| - | # | + | |
| - | if [ " | + | |
| - | | + | |
| - | | + | |
| - | fi | + | |
| - | + | ||
| - | | + | |
| - | } | + | |
| - | + | ||
| - | case " | + | |
| - | | + | |
| - | echo -n " | + | |
| - | | + | |
| - | | + | |
| - | echo " | + | |
| - | ;; | + | |
| - | | + | |
| - | echo -n " | + | |
| - | | + | |
| - | echo " | + | |
| - | ;; | + | |
| - | reload|force-reload) | + | |
| - | echo -n " | + | |
| - | start-stop-daemon --stop --quiet --signal 1 --exec $binpath --pidfile $pidfile | + | |
| - | echo " | + | |
| - | ;; | + | |
| - | restart) | + | |
| - | echo -n " | + | |
| - | start-stop-daemon --stop --quiet --exec $binpath --pidfile $pidfile | + | |
| - | sleep 1 | + | |
| - | start-stop-daemon --start --quiet --exec $binpath -- $SYSLOGD | + | |
| - | echo " | + | |
| - | ;; | + | |
| - | reload-or-restart) | + | |
| - | if running | + | |
| - | then | + | |
| - | echo -n " | + | |
| - | start-stop-daemon --stop --quiet --signal 1 --exec $binpath --pidfile $pidfile | + | |
| - | else | + | |
| - | echo -n " | + | |
| - | | + | |
| - | fi | + | |
| - | echo " | + | |
| - | ;; | + | |
| - | *) | + | |
| - | echo " | + | |
| - | exit 1 | + | |
| - | esac | + | |
| - | + | ||
| - | exit 0 | + | |
| - | Restart | + | Add to the file **''/ |
| - | / | + | < |
| + | zone " | ||
| + | type forward; | ||
| + | forward only; | ||
| + | forwarders { 192.168.0.2; | ||
| + | }; | ||
| + | </code> | ||
| - | Start up BIND, and check '' | + | Of course you need to replace |
| - | /etc/init.d/bind9 start | + | |
| + | ==== Unsorted ==== | ||
| + | |||
| + | |||
| + | host -t txt -c CHAOS version.bind localhost | ||
| + | |||
| + | named - options {version "DNS daemon"; | ||
| + | |||
| + | host -t txt -c CHAOS hostname.bind localhost | ||
| + | |||
| + | gethostbyname() | ||
| + | |||
| + | |||
| + | ==== audit dns ==== | ||
| + | < | ||
| + | kernel: audit(1209076817.081: | ||
| + | </ | ||
| + | |||
| + | So I had a look in: | ||
| + | ''/ | ||
| + | |||
| + | and changed this line: | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | to this: | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | ==== Fixing syntax highlighting in VIM ==== | ||
| + | |||
| + | **~/ | ||
| + | < | ||
| + | " BIND zone | ||
| + | au BufNewFile, | ||
| + | " BIND configuration | ||
| + | au BufNewFile, | ||
| + | </ | ||

