Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
lpi1:bind_caching_only [2018/09/10 11:08] |
lpi1:bind_caching_only [2021/12/01 09:59] (aktuell) |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== Benötigte Pakete ====== | ||
+ | openSuSE 15.0: ''bind bind-utils'' | ||
+ | |||
+ | Fedora 28 und CentOS 7: ''bind bind-utils caching-nameserver'' | ||
+ | |||
+ | Debian ab 3.1: ''bind9'' | ||
+ | (( zusätzlich ist ''bind9utils'' und ''bind-doc'' hilfreich )) | ||
+ | |||
+ | ====== bind als caching only resolver ====== | ||
+ | Das ist die Standard-Konfiguration, die Konfigurationsdatei muß nicht angepaßt werden. | ||
+ | |||
+ | ===== Dienst starten ===== | ||
+ | === SuSE und RedHat === | ||
+ | service named start | ||
+ | |||
+ | Dauerhaft eintragen: | ||
+ | chkconfig named on | ||
+ | |||
+ | === Debian === | ||
+ | Wird bei der Installation gestartet | ||
+ | |||
+ | ===== testen ===== | ||
+ | host www.whitehouse.gov 127.0.0.1 | ||
+ | |||
+ | ===== Rekursive Anfrage ===== | ||
+ | dig +trace www.wupperrafting.de. | ||
+ | |||
+ | ===== cache leeren ===== | ||
+ | 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 ====== | ||
+ | ===== Vorbereiten ===== | ||
+ | === CentOS 5 === | ||
+ | Paket ''caching-nameserver'' deinstallieren | ||
+ | Paket ''system-config-bind'' installieren | ||
+ | Mit | ||
+ | system-config-bind | ||
+ | Default-Konfigurationsdateien erzeugen | ||
+ | |||
+ | ===== Forwarder eintragen ===== | ||
+ | ''/etc/named.conf'' : ( Fedora, CentOS ) | ||
+ | |||
+ | ''/etc/bind/named.conf.options'' : ( Debian ) | ||
+ | <file> | ||
+ | options { | ||
+ | forwarders { 192.168.1.6; 192.168.1.4; }; | ||
+ | }; | ||
+ | </file> | ||
+ | |||
+ | ''/etc/named.conf'' : ( SuSE 11.1 ) | ||
+ | <file> | ||
+ | options { | ||
+ | include "/etc/named.d/forwarders.conf"; | ||
+ | }; | ||
+ | </file> | ||
+ | |||
+ | ''/etc/named.d/forwarders.conf'' : ( SuSE 11.1 ) | ||
+ | <file> | ||
+ | forwarders { 192.168.1.6; 192.168.1.4; }; | ||
+ | </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 | ||