Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Nächste Überarbeitung | Vorherige Überarbeitung | ||
fortgeschrittene:bind_caching_only [2010/11/15 11:11] 127.0.0.1 Externe Bearbeitung |
fortgeschrittene:bind_caching_only [2021/12/01 09:59] (aktuell) |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Benötigte Pakete ====== | ====== Benötigte Pakete ====== | ||
- | SuSE 10.0: | + | openSuSE 15.0: ''bind bind-utils'' |
- | bind bind-utils | + | |
- | Fedora 6 und CentOS 5: | + | Fedora 28 und CentOS 7: ''bind bind-utils caching-nameserver'' |
- | bind bind-utils caching-nameserver | + | |
- | Debian 3.1: | + | Debian ab 3.1: ''bind9'' |
- | bind9 | + | (( zusätzlich ist ''bind9utils'' und ''bind-doc'' hilfreich )) |
====== bind als caching only resolver ====== | ====== bind als caching only resolver ====== | ||
Das ist die Standard-Konfiguration, die Konfigurationsdatei muß nicht angepaßt werden. | Das ist die Standard-Konfiguration, die Konfigurationsdatei muß nicht angepaßt werden. | ||
- | SuSE und RedHat: | + | ===== Dienst starten ===== |
- | /etc/init.d/named start | + | === SuSE und RedHat === |
+ | service named start | ||
- | Dauerhaft eintragen bei SuSE und RedHat: | + | Dauerhaft eintragen: |
chkconfig named on | chkconfig named on | ||
- | Debian: | + | === Debian === |
- | /etc/init.d/bind9 start | + | Wird bei der Installation gestartet |
- | + | ||
===== testen ===== | ===== testen ===== | ||
host www.whitehouse.gov 127.0.0.1 | host www.whitehouse.gov 127.0.0.1 | ||
+ | |||
+ | ===== Rekursive Anfrage ===== | ||
+ | dig +trace www.wupperrafting.de. | ||
===== cache leeren ===== | ===== cache leeren ===== | ||
rndc flush | rndc flush | ||
+ | |||
+ | ===== Zugriffsbeschränkung ===== | ||
+ | bind beschränkt Abfragen seit Version 9.4.1 in der Voreinstellung wie folgt: | ||
+ | <file> | ||
+ | options { | ||
+ | ... | ||
+ | allow-recursion { localnets; localhost; }; | ||
+ | allow-query-cache { localnets; localhost; }; | ||
+ | ... | ||
+ | }; | ||
+ | </file> | ||
+ | Sollen auch Rechner aus anderen Subnetzen auf diesen Nameserver zugreifen können, muss man diese Einschränkungen aufweichen. Z.B.: | ||
+ | <file> | ||
+ | acl "trusted" { | ||
+ | 192.168.0.0/16; | ||
+ | 10.153.154.0/24; | ||
+ | localhost; | ||
+ | localnets; | ||
+ | }; | ||
+ | |||
+ | options { | ||
+ | ... | ||
+ | allow-query { any; }; | ||
+ | allow-recursion { trusted; }; | ||
+ | allow-query-cache { trusted; }; | ||
+ | ... | ||
+ | }; | ||
+ | </file> | ||
====== bind als caching only forwarder ====== | ====== bind als caching only forwarder ====== | ||
Zeile 40: | Zeile 68: | ||
===== Forwarder eintragen ===== | ===== Forwarder eintragen ===== | ||
''/etc/named.conf'' : ( Fedora, CentOS ) | ''/etc/named.conf'' : ( Fedora, CentOS ) | ||
+ | |||
''/etc/bind/named.conf.options'' : ( Debian ) | ''/etc/bind/named.conf.options'' : ( Debian ) | ||
<file> | <file> | ||
options { | options { | ||
forwarders { 192.168.1.6; 192.168.1.4; }; | forwarders { 192.168.1.6; 192.168.1.4; }; | ||
- | } | + | }; |
</file> | </file> | ||
Zeile 51: | Zeile 80: | ||
options { | options { | ||
include "/etc/named.d/forwarders.conf"; | include "/etc/named.d/forwarders.conf"; | ||
- | } | + | }; |
</file> | </file> | ||
Zeile 58: | Zeile 87: | ||
forwarders { 192.168.1.6; 192.168.1.4; }; | forwarders { 192.168.1.6; 192.168.1.4; }; | ||
</file> | </file> | ||
+ | |||
+ | ====== Logging ====== | ||
+ | ===== querylogging ===== | ||
+ | //Achtung: macht bind sehr langsam// | ||
+ | ==== temporär ==== | ||
+ | rndc querylog on | ||
+ | rndc status | grep "query logging" | ||
+ | tail /var/log/daemon.log | ||
+ | |||
+ | rndc querylog off | ||
+ | ==== dauerhaft ==== | ||
+ | === einfach === | ||
+ | <file> | ||
+ | options { | ||
+ | … | ||
+ | querylog yes; | ||
+ | … | ||
+ | }; | ||
+ | </file> | ||
+ | |||
+ | === in separate Datei === | ||
+ | <file> | ||
+ | logging { | ||
+ | channel mein_query_log { | ||
+ | file "/var/lib/bind/query.log" versions 10 size 50M; | ||
+ | print-time yes; | ||
+ | }; | ||
+ | category queries { | ||
+ | mein_query_log; | ||
+ | }; | ||
+ | }; | ||
+ | </file> | ||
+ | |||
+ | == Doku == | ||
+ | * The category Phrase: https://bind9.readthedocs.io/en/latest/reference.html#the-category-phrase | ||
+ | |||
+ | ===== logging von "Lame-Servers" ausschalten ===== | ||
+ | <file> | ||
+ | logging { | ||
+ | category lame-servers { | ||
+ | null; | ||
+ | }; | ||
+ | }; | ||
+ | </file> | ||
+ | ====== Fehlersuche ====== | ||
+ | dnstop | ||