Linuxhotel Wiki

Wie ging das nochmal?

Benutzer-Werkzeuge

Webseiten-Werkzeuge


lpi2:bind

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
lpi2:bind [2016/06/22 14:18] – [Zonendatei] ingo_wichmannlpi2:bind [2026/03/20 15:15] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 2: Zeile 2:
  
 ===== Vorbereiten ===== ===== Vorbereiten =====
-=== CentOS 5 ===+=== systemd-resolvd === 
 +"systemd-resolved is not intended to be used on DNS servers. If you’re running a DNS server, you’ll need to disable systemd-resolved before setting up BIND or Unbound instead" 
 +=== CentOS 7 ===
 Paket ''caching-nameserver'' deinstallieren Paket ''caching-nameserver'' deinstallieren
  
-Paket ''system-config-bind'' installieren +=== DNSSEC temporär abschalten === 
-Mit  +''/etc/named.conf'' : CentOS
-  system-config-bind +
-Default-Konfigurationsdateien erzeugen+
  
-=== CentOS 6 === +''/etc/bind/named.conf.options'' : Debian (ab 12)
-''/etc/named.conf'' :+
 <file> <file>
 options { options {
- +… 
-        // listen-on port 53 { 127.0.0.1; }; +        // In der Praxis ist DNSSEC eine gute Sache ... aber im Intranet zum Lernen erst mal aus:
-        // listen-on-v6 port 53 { ::1; }; +
-        // allow-query     { localhost; }; +
- +
-        // In der Praxis ist DNSSEC eine gute Sache ... aber zum Lernen erst mal aus: +
-        dnssec-enable no;+
         dnssec-validation no;         dnssec-validation no;
-        dnssec-lookaside no; +… 
 +}
 </file> </file>
 (( mehr zu ''allow-query'' weiter unten im Kapitel "Bind absichern" und natürlich unter  (( mehr zu ''allow-query'' weiter unten im Kapitel "Bind absichern" und natürlich unter 
   man named.conf   man named.conf
 )) ))
-====== eigene Zonen in bind verwalten ====== +  named-checkconf  
-===== Vorwärts-Zone ===== +  rndc reconfig
-==== Zonendatei ==== +
-Unter Debian und CentOS empfehlen wir ein entsprechendes Verzeichnis ''master'' für die Zonendateien noch anzulegen ((oder man legt die Zonendateien direkt in /var/cache/bind bzw. /var/named ab)):+
  
-Debian : +== testen == 
-  mkdir /var/cache/bind/master +Eine mit DNSSEC signierte Zone abfragen:
-CentOS (ab 5) : +
-  mkdir /var/named/master+
  
-''/var/named/master/linuxhotel.de'' : ( CentOS ab 5 )+Ein validierender Nameserver sollte bei einer signierten Zone liefern: 
 +  dig www.posteo.de @1.1.1.1
  
-''/var/lib/named/master/linuxhotel.de'' : ( SuSE ab 10.0)+-> ''flags: … ad''
  
-''/var/cache/bind/master/linuxhotel.de'' : ( Debian ab 3.1 ) +Unser Nameserver sollte das ad-Flag nicht setzen. 
-<file>+ 
 +===== eigene Zonen in bind verwalten ===== 
 +==== Vorwärts-Zone ==== 
 +=== Zonendatei === 
 + 
 +  * ''/var/named/linuxhotel.de'' : ( CentOS ) 
 +  * ''/var/lib/named/linuxhotel.de'' : ( SuSE ) 
 +  * ''/var/cache/bind/linuxhotel.de'' : ( Debian ) 
 + 
 +<file txt linuxhotel.de>
 $ORIGIN . ; hilft Tippfehler (fehlender . am Ende) zu vermeiden $ORIGIN . ; hilft Tippfehler (fehlender . am Ende) zu vermeiden
-$TTL 2h +$TTL 2m   ; time to live: 2 Minuten, default wäre 2 Tage 
-linuxhotel.de. IN SOA notebook20.linuxhotel.de. root.notebook20.linuxhotel.de. (+linuxhotel.de. SOA notebook20.linuxhotel.de. root.notebook20.linuxhotel.de. (
         1             ; Seriennummer         1             ; Seriennummer
-        3h            ; refresh +        1h20m         ; refresh      / 1 Stunde 20 Minuten 
-        1h            ; retry +        1d12h         ; retry        / 1,5 Tage 
-        1w            ; expire +        1w            ; expire       / 1 Woche 
-        1h            ; negative ttl+        60s           ; negative ttl / 60 Sekunden
 ) )
  
 ; Nameserver: ; Nameserver:
-linuxhotel.de.                  IN NS notebook20.linuxhotel.de.+linuxhotel.de.                  NS notebook20.linuxhotel.de.
  
 ; kanonische IP-Adressen: ; kanonische IP-Adressen:
-notebook22.linuxhotel.de.       IN A 192.168.1.222 +notebook22.linuxhotel.de.       A 192.168.1.222 
-notebook05.linuxhotel.de.       IN A 192.168.1.205 +notebook05.linuxhotel.de.       A 192.168.1.205 
-notebook20.linuxhotel.de.       IN A 192.168.1.220 +notebook20.linuxhotel.de.       A 192.168.1.220 
-notebook06.linuxhotel.de.       IN A 192.168.1.206 +notebook06.linuxhotel.de.       A 192.168.1.206 
-notebook09.linuxhotel.de.       IN A 192.168.1.209+notebook09.linuxhotel.de.       A 192.168.1.209 
 + 
 +notebook22.linuxhotel.de.       AAAA 2a0f:6480:1:600::222 
 +notebook05.linuxhotel.de.       AAAA 2a0f:6480:1:600::205 
 +notebook20.linuxhotel.de.       AAAA 2a0f:6480:1:600::220 
 +notebook06.linuxhotel.de.       AAAA 2a0f:6480:1:600::206 
 +notebook09.linuxhotel.de.       AAAA 2a0f:6480:1:600::209
  
 ; Aliase: ; Aliase:
-peter.linuxhotel.de.            IN CNAME notebook09.linuxhotel.de. +peter.linuxhotel.de.            CNAME notebook09.linuxhotel.de. 
-lothar.linuxhotel.de.           IN CNAME notebook05.linuxhotel.de. +lothar.linuxhotel.de.        60 CNAME notebook05.linuxhotel.de. 
-heribert.linuxhotel.de.         IN CNAME notebook06.linuxhotel.de. +heribert.linuxhotel.de.      30 CNAME notebook06.linuxhotel.de. 
-bjoern.linuxhotel.de.           IN CNAME notebook20.linuxhotel.de. +bjoern.linuxhotel.de.           CNAME notebook20.linuxhotel.de. 
-admin.linuxhotel.de.            IN CNAME notebook22.linuxhotel.de.+admin.linuxhotel.de.            CNAME notebook22.linuxhotel.de.
 </file> </file>
  
 === Zonendatei überprüfen === === Zonendatei überprüfen ===
-== CentOS ab 5 == +== CentOS == 
-  named-checkzone -D linuxhotel.de. /var/named/master/linuxhotel.de+  named-checkzone -D linuxhotel.de. /var/named/linuxhotel.de
  
-== SuSE ab 10.0 == +== SuSE == 
-  named-checkzone -D linuxhotel.de. /var/lib/named/master/linuxhotel.de+  named-checkzone -D linuxhotel.de. /var/lib/named/linuxhotel.de
  
-== Debian ab 3.1 == +== Debian == 
-  named-checkzone -D linuxhotel.de. /var/cache/bind/master/linuxhotel.de+  named-checkzone -D linuxhotel.de. /var/cache/bind/linuxhotel.de 
 + 
 +=== Konfigurationsdatei === 
 +  * ''/etc/named.conf'' : ( SuSE ) 
 +  * ''/etc/named.conf'' : ( CentOS ) 
 +  * ''/etc/bind/named.conf.local'' : ( Debian ) 
 +<file> 
 +zone "linuxhotel.de" { 
 +  type primary; 
 +  file "linuxhotel.de"; 
 +}; 
 +</file> 
 + 
 +Konfigdatei und eingetragene Zonen überprüfen: 
 +  named-checkconf -z 
 + 
 +=== bind die Änderung mitteilen === 
 +  rndc reconfig 
 +((oder  
 + 
 +openSuSE, CentOS 
 +  service named reload 
 + 
 +Debian 
 +  service bind9 reload 
 +)) 
 +=== im Log prüfen, ob es Fehler gab === 
 +Debian 
 +  journalctl -eu named.service 
 + 
 +=== testen === 
 +  host peter.linuxhotel.de ::1 
 +  dig peter.linuxhotel.de @::1 any
  
-==== Zonendatei (kurze Schreibweise) ==== +=== Zonendatei (kürzere Schreibweise) === 
-Das Format der Zonendatei (([[http://tools.ietf.org/html/rfc1035|rfc1035]])) läßt es auch zu, diese Datei sehr viel kürzer zu schreiben:+Das Format der Zonendatei ((RFC [[rfc>1035]])) läßt es auch zu, diese Datei kürzer zu schreiben:
 <file> <file>
 $TTL 2h $TTL 2h
-@ IN SOA notebook20 root.notebook20 1 3h 1h 1w 1h+@ SOA notebook20.linuxhotel.de. root.notebook20.linuxhotel.de. 1999022301 1d 2h 5w 2d
  
 ; Nameserver: ; Nameserver:
-                 IN NS notebook20+                 NS notebook20.linuxhotel.de. 
 + 
 +; kein Mailserver, weder empfangen (RFC 7505), noch senden: 
 +                 MX 0 . 
 +                 TXT "v=spf1 -all"
  
 ; kanonische IP-Adressen: ; kanonische IP-Adressen:
-notebook22       IN A 192.168.1.222 +notebook22       A 192.168.1.222 
-notebook05       IN A 192.168.1.205 +                 AAAA 2a0f:6480:1:600::222 
-notebook20       IN A 192.168.1.220 +notebook05       A 192.168.1.205 
-notebook06       IN A 192.168.1.206 +                 AAAA 2a0f:6480:1:600::205 
-notebook09       IN A 192.168.1.209+notebook20       A 192.168.1.220 
 +                 AAAA 2a0f:6480:1:600::220 
 +notebook06       A 192.168.1.206 
 +                 AAAA 2a0f:6480:1:600::206 
 +notebook09       A 192.168.1.209 
 +                 AAAA 2a0f:6480:1:600::209
  
 ; Aliase: ; Aliase:
-peter            IN CNAME notebook09 +peter            CNAME notebook09 
-lothar           IN CNAME notebook05 +lothar           CNAME notebook05 
-heribert         IN CNAME notebook06 +heribert      60 CNAME notebook06 
-bjoern           IN CNAME notebook20 +bjoern        30 CNAME notebook20 
-admin            IN CNAME notebook22+admin            CNAME notebook22
 </file> </file>
 +
 +Hier habe ich die Zeitangaben im SOA entsprechend der Empfehlungen des Ripe ((
 +https://www.ripe.net/publications/docs/ripe-203
 +<file>
 +example.com.  3600  SOA  dns.example.com. hostmaster.example.com. (
 +                         1999022301   ; serial YYYYMMDDnn
 +                         86400        ; refresh (  24 hours)
 +                         7200         ; retry   (   2 hours)
 +                         3600000      ; expire  (1000 hours)
 +                         172800 )     ; minimum (   2 days)
 +</file>
 +)) gewählt. 
  
 Bei jeder Änderung der Zonendatei sollte die Seriennummer hochgezählt werden. Bei jeder Änderung der Zonendatei sollte die Seriennummer hochgezählt werden.
  
 === Zonendatei überprüfen === === Zonendatei überprüfen ===
-== CentOS 5 == +== CentOS == 
-  named-checkzone -D linuxhotel.de. /var/named/master/linuxhotel.de+  named-checkzone -D linuxhotel.de. /var/named/linuxhotel.de
  
-== SuSE 10.0 == +== SuSE == 
-  named-checkzone -D linuxhotel.de. /var/lib/named/master/linuxhotel.de+  named-checkzone -D linuxhotel.de. /var/lib/named/linuxhotel.de
  
-== Debian 3.1 == +== Debian == 
-  named-checkzone -D linuxhotel.de. /var/cache/bind/master/linuxhotel.de+  named-checkzone -D linuxhotel.de. /var/cache/bind/linuxhotel.de
  
-==== Konfigurationsdatei ==== +=== bind die Änderung mitteilen === 
-''/etc/named.conf'' : ( SuSE 10.2 )+  rndc reload linuxhotel.de
  
-''/etc/named.conf'' : ( CentOS ab 5 )+==== Rückwärts-Zone IPv4 ==== 
 +=== Zonendatei === 
 +  * ''/var/named/1.168.192.in-addr.arpa'': ( CentOS ) 
 +  * ''/var/lib/named/1.168.192.in-addr.arpa'': ( SuSE 10.0 ) 
 +  * ''/var/cache/bind/1.168.192.in-addr.arpa'': ( Debian 3.1 )
  
-''/etc/bind/named.conf.local'' : ( Debian ab 5.0 ) 
 <file> <file>
-  zone "linuxhotel.de" { +$TTL 2h 
-        type master; +@ SOA notebook20.linuxhotel.de. root.notebook20.linuxhotel.de. 1999022301 1d 2h 5w 2d
-        file "master/linuxhotel.de"; +
-  }; +
-</file>+
  
-Konfigdatei und eingetragene Zonen überprüfen: +; Nameserver: 
-  named-checkconf -z+                 NS notebook20.linuxhotel.de.
  
-=== bind die Änderung mitteilen === +; kanonische IP-Adressen 
-  rndc reconfig +205.1.168.192.in-addr.arpa. IN PTR notebook05.linuxhotel.de. 
-oder +220.1.168.192.in-addr.arpa. IN PTR notebook20.linuxhotel.de. 
 +206.1.168.192.in-addr.arpa. IN PTR notebook06.linuxhotel.de. 
 +209.1.168.192.in-addr.arpa. IN PTR notebook09.linuxhotel.de. 
 +222.1.168.192.in-addr.arpa. IN PTR notebook22.linuxhotel.de. 
 +</file>
  
-openSuSE, centos (ab 7) +=== testen === 
-  service named reload+== CentOS == 
 +  named-checkzone -D 1.168.192.in-addr.arpa. /var/named/1.168.192.in-addr.arpa
  
-Debian (ab 6) +== SuSE == 
-  service bind9 reload+  named-checkzone -D 1.168.192.in-addr.arpa. /var/lib/named/1.168.192.in-addr.arpa
  
-==== testen ==== +== Debian == 
-  host peter.linuxhotel.de 127.0.0.1 +  named-checkzone -D 1.168.192.in-addr.arpa. /var/cache/bind/1.168.192.in-addr.arpa
-  dig peter.linuxhotel.de @127.0.0.1 any+
  
-===== Rückwärts-Zone ===== +=== Konfigurationsdatei === 
-==== Zonendatei ==== +  * ''/etc/named.conf'' : ( SuSE 10.2 ) 
-''/var/named/master/1.168.192.in-addr.arpa'': ( CentOS )+  * ''/etc/named.conf'' : ( CentOS ) 
 +  * ''/etc/bind/named.conf.local'' : ( Debian 3.1 ) 
 +<file> 
 +zone "1.168.192.in-addr.arpa" { 
 +      type primary; 
 +      file "1.168.192.in-addr.arpa"; 
 +}; 
 +</file> 
 +==  Syntax der Konfigurationsdatei prüfen == 
 +  named-checkconf -z
  
-''/var/lib/named/master/1.168.192.in-addr.arpa'': ( SuSE 10.0 )+== bind die Änderung mitteilen == 
 +  rndc reconfig 
 +=== testen ===   
 +  host 192.168.1.222 ::1 
 +  dig -x 192.168.1.222 @::1
  
-''/var/cache/bind/master/1.168.192.in-addr.arpa'': ( Debian 3.1 )+==== Rückwärts-Zone IPv6 ==== 
 +Paket: 
 +  * Debian (12): ''ipv6calc'' 
 +=== Zonendatei === 
 +  ipv6calc --out revnibbles.arpa --in ipv6addr 2a0f:6480:1:600::222 
 +-> ''2.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa.'' 
 +  * ''/var/named/0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa'': ( CentOS ) 
 +  * ''/var/lib/named/0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa'': ( SuSE ) 
 +  * ''/var/cache/bind/0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa'': ( Debian )
  
 <file> <file>
 $TTL 2h $TTL 2h
-1.168.192.in-addr.arpa. IN SOA notebook20.linuxhotel.de. root.notebook20.linuxhotel.de. ( +@ SOA notebook20.linuxhotel.de. root.notebook20.linuxhotel.de. 1999022301 1d 2h 5w 2d 
-    2005082401    ; serial + 
-    3h            ; refresh +; Nameserver: 
-    1h            ; retry +                 NS notebook20.linuxhotel.de.
-    1w            ; expire +
-    1h            ; negative ttl +
-)   +
-; Nameserver +
-1.168.192.in-addr.arpa. IN NS notebook20.linuxhotel.de.+
  
 ; kanonische IP-Adressen ; kanonische IP-Adressen
-205.1.168.192.in-addr.arpa. IN PTR notebook05.linuxhotel.de. +2.0.5.0.0.0.0.0.0.0.0.0.0.0.0.0. IN PTR notebook05.linuxhotel.de. 
-220.1.168.192.in-addr.arpa. IN PTR notebook20.linuxhotel.de. +2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0. IN PTR notebook20.linuxhotel.de. 
-206.1.168.192.in-addr.arpa. IN PTR notebook06.linuxhotel.de. +2.0.6.0.0.0.0.0.0.0.0.0.0.0.0.0. IN PTR notebook06.linuxhotel.de. 
-209.1.168.192.in-addr.arpa. IN PTR notebook09.linuxhotel.de. +2.0.9.0.0.0.0.0.0.0.0.0.0.0.0.0. IN PTR notebook09.linuxhotel.de. 
-222.1.168.192.in-addr.arpa. IN PTR notebook22.linuxhotel.de.+2.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0. IN PTR notebook22.linuxhotel.de.
 </file> </file>
  
 === testen === === testen ===
-  named-checkzone linuxhotel.de /var/lib/named/master/linuxhotel.de +== CentOS == 
-  named-checkzone 1.168.192.in-addr.arpa. /var/lib/named/master/1.168.192.in-addr.arpa+  named-checkzone -D 0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa. /var/named/0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa
  
-==== Konfigurationsdatei ==== +== SuSE == 
-''/etc/named.conf'' : ( SuSE 10.2 )+  named-checkzone -D 0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa. /var/lib/named/0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa 
 +== Debian == 
 +  named-checkzone -D 0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa. /var/cache/bind/0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa
  
-''/etc/named.conf'' : ( CentOS ) +=== Konfigurationsdatei === 
- +  * ''/etc/named.conf'' : ( SuSE ) 
-''/etc/bind/named.conf.local'' : ( Debian 3.1 )+  * ''/etc/named.conf'' : ( CentOS ) 
 +  * ''/etc/bind/named.conf.local'' : ( Debian )
 <file> <file>
-zone "1.168.192.in-addr.arpa" { +zone "0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa" { 
-      type master; +      type primary; 
-      file "master/1.168.192.in-addr.arpa";+      file "0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa";
 }; };
 </file> </file>
-===  testen === +==  Syntax der Konfigurationsdatei prüfen == 
-  named-checkconf+  named-checkconf -z
  
-=== bind die Änderung mitteilen ===+== bind die Änderung mitteilen ==
   rndc reconfig   rndc reconfig
-==== testen ====   +=== testen ===   
-  host 192.168.1.222 127.0.0.1 +  host 2a0f:6480:1:600::222 ::1 
-  dig -x 192.168.1.222 @127.0.0.1+  dig -x 2a0f:6480:1:600::222 @::1
  
 ===== Zonendateien mit nsupdate bearbeiten ===== ===== Zonendateien mit nsupdate bearbeiten =====
 ==== bind konfigurieren ==== ==== bind konfigurieren ====
-''/etc/named.conf'' : ( SuSE, CentOS ) +  * ''/etc/named.conf'' : ( SuSE, CentOS ) 
- +  * ''/etc/bind/named.conf.local'' : ( Debian ) 
-''/etc/bind/named.conf.local'' : ( Debian )+mit ''allow-update'':
 <file> <file>
 acl "nsupdate" { acl "nsupdate" {
Zeile 212: Zeile 294:
  
 zone "linuxhotel.de" { zone "linuxhotel.de" {
-        type master;+        type primary;
         allow-update { "nsupdate"; };         allow-update { "nsupdate"; };
-        file "master/linuxhotel.de";+        file "linuxhotel.de";
 }; };
  
 zone "1.168.192.in-addr.arpa" { zone "1.168.192.in-addr.arpa" {
-        type master;+        type primary;
         allow-update { "nsupdate"; };         allow-update { "nsupdate"; };
-        file "master/1.168.192.in-addr.arpa";+        file "1.168.192.in-addr.arpa";
 }; };
 </file> </file>
  
 +oder mit ''update-policy local'':
 +<file>
 +zone "linuxhotel.de" {
 +        type primary;
 +        update-policy local;
 +        file "linuxhotel.de";
 +};
 +</file>
 ==== bind Konfigurationsdatei prüfen ==== ==== bind Konfigurationsdatei prüfen ====
   named-checkconf   named-checkconf
  
-==== bind Schreibzugriff auf Master-Zonendateien geben ====+==== bind Schreibzugriff auf Primary-Zonendateien geben ====
 Debian: Debian:
-  chown -R bind /var/cache/bind/master+  chown bind /var/cache/bind/linuxhotel.de
  
 ==== Testen: Eintrag hinzufügen ==== ==== Testen: Eintrag hinzufügen ====
-  nsupdate <<EOF+für ''allow-update'':
 <file> <file>
 +nsupdate <<EOT
 +
 server localhost server localhost
  
Zeile 240: Zeile 332:
 update add 223.1.168.192.in-addr.arpa 43200 IN PTR notebook23.linuxhotel.de update add 223.1.168.192.in-addr.arpa 43200 IN PTR notebook23.linuxhotel.de
  
 +EOT
 +</file>
 +
 +für ''update-policy local'':
 +<file>
 +nsupdate -l <<EOT
 +
 +update add notebook23.linuxhotel.de 43200 IN A 192.168.1.223
 +
 +update add 223.1.168.192.in-addr.arpa 43200 IN PTR notebook23.linuxhotel.de
 +
 +EOT
 </file> </file>
-  EOF 
  
 ==== Trotz nsupdate Zonen mit Editor bearbeiten ==== ==== Trotz nsupdate Zonen mit Editor bearbeiten ====
Zeile 252: Zeile 355:
  
 ''~/.bashrc'' : ''~/.bashrc'' :
-<file>+<code bash>
 function zvi { function zvi {
-  cd /var/cache/bind/master+  cd /var/cache/bind
   rndc freeze $1   rndc freeze $1
   vim $1   vim $1
Zeile 261: Zeile 364:
   cd -   cd -
 } }
-</file>+</code> 
 + 
 +===== mehrere NS für eine Zone ===== 
 +==== Master? Primary! Slave? Secondary! ;-) ==== 
 +//**Mittlerweile **(Version)** sind auch die Begriffe primary und secondary als Ersatz für master und slave möglich**// 
 + 
 +  masters { ...; };  =>  primaries { ...; }; 
 +  type master;  =>  type primary; 
 +  type slave;   =>  type secondary;
  
-====== bind als slave einrichten ====== +==== Primary konfigurieren ==== 
-===== Master konfigurieren ===== +Erst müssen die Secondary-Nameserver in der Zonendatei des Primarys eingetragen werden:
-Erst müssen die Slave-Nameserver in der Zonendatei des Masters eingetragen werden:+
 <file> <file>
 linuxhotel.de. IN NS notebook04.linuxhotel.de. linuxhotel.de. IN NS notebook04.linuxhotel.de.
Zeile 275: Zeile 385:
 </file> </file>
 in der Datei ''/etc/named.conf'' eingetragen werden, oder die Zeile ganz entfernt oder auskommentiert werden. in der Datei ''/etc/named.conf'' eingetragen werden, oder die Zeile ganz entfernt oder auskommentiert werden.
-=== testen: funktioniert der Master ===+=== testen: funktioniert der Primary? ===
 == openSuSE 12.3 == == openSuSE 12.3 ==
-  cd /var/lib/named/master +  named-checkzone -i local -D linuxhotel.de /var/lib/named/linuxhotel.de
-  named-checkzone -i local -D linuxhotel.de linuxhotel.de+
   rndc reload linuxhotel.de   rndc reload linuxhotel.de
   tail /var/log/messages   tail /var/log/messages
-  dig @127.0.0.1 linuxhotel.de NS+  dig @::1 linuxhotel.de NS
  
 +== debian 8 ==
 +  named-checkzone -i local -D linuxhotel.de /var/cache/bind/linuxhotel.de
 +  rndc reload linuxhotel.de
 +  journalctl -eu bind9
 +  dig @::1 linuxhotel.de NS
  
-==== Slave konfigurieren ==== +==== Secondary konfigurieren ==== 
-Vorraussetzung: Master funktioniert +Vorraussetzung: Primary funktioniert 
-  dig @<IP-des-Masters> linuxhotel.de AXFR+  dig @<IP-des-Primary> linuxhotel.de AXFR
  
 Ausgabe muss mindestens 2 NS Records enthalten: Ausgabe muss mindestens 2 NS Records enthalten:
   - den eigenen Rechner   - den eigenen Rechner
-  - den Master+  - den Primary
  
 ''/etc/named.conf'' : ( CentOS 5.3 ) ''/etc/named.conf'' : ( CentOS 5.3 )
 <file> <file>
 zone "linuxhotel.de" { zone "linuxhotel.de" {
-        type slave; +        type secondary; 
-        file "slaves/linuxhotel.de";+        file "secondary/linuxhotel.de";
         masters { 192.168.1.220; };         masters { 192.168.1.220; };
 }; };
 zone "1.168.192.in-addr.arpa" { zone "1.168.192.in-addr.arpa" {
-        type slave; +        type secondary; 
-        file "slaves/1.168.192.in-addr.arpa";+        file "secondary/1.168.192.in-addr.arpa";
         masters { 192.168.1.220; };         masters { 192.168.1.220; };
 }; };
 </file> </file>
  
-''/etc/named.conf'' : ( SuSE 10.0 ) +  * ''/etc/named.conf'' : ( SuSE 10.0 ) 
- +  * ''/etc/bind/named.conf.local'' : ( Debian )
-''/etc/bind/named.conf.local'' : ( Debian )+
 <file> <file>
 zone "linuxhotel.de" { zone "linuxhotel.de" {
-        type slave; +        type secondary; 
-        file "slave/linuxhotel.de"; +        file "secondary/linuxhotel.de"; 
-        masters { 192.168.1.220; };+        primaries { 192.168.1.220; };
 }; };
 zone "1.168.192.in-addr.arpa" { zone "1.168.192.in-addr.arpa" {
-        type slave; +        type secondary; 
-        file "slave/1.168.192.in-addr.arpa"; +        file "secondary/1.168.192.in-addr.arpa"; 
-        masters { 192.168.1.220; };+        primaries { 192.168.1.220; };
 }; };
 </file> </file>
  
-==== bind Schreibzugriff auf Slave-Zonendateien geben ====+Zonendateien im Binärformat kann man mit: 
 +  named-checkzone -D -f raw linuxhotel.de secondary/linuxhotel.de 
 +oder 
 +  named-compilezone -f raw -F text -o - example.org. /var/cache/bind/secondary/example.org 
 +anzeigen. Wenn man die Zonenfiles **lieber im Textformat statt im Binärformat** haben will, kann man in die Zone eintragen: 
 +<file txt> 
 +zone "…" { 
 +  … 
 +  masterfile-format text; 
 +  … 
 +</file> 
 + 
 +=== bind Schreibzugriff auf Secondary-Zonendateien geben ===
 Debian: Debian:
-  mkdir /var/cache/bind/slave +  mkdir /var/cache/bind/secondary 
-  chown bind /var/cache/bind/slave+  chown bind /var/cache/bind/secondary
  
-==== testen: funktioniert der Slave? ====+=== testen: funktioniert der Secondary? ===
 == Debian == == Debian ==
   named-checkconf -z   named-checkconf -z
   rndc reconfig   rndc reconfig
-  tail /var/log/daemon.log +  journalctl -eu bind9 
-  ls /var/lib/named/slave/{linuxhotel.de,1.168.192.in-addr.arpa} +  ls /var/cache/bind/secondary/{linuxhotel.de,1.168.192.in-addr.arpa} 
-  dig @127.0.0.1 linuxhotel.de AXFR+  dig @::1 linuxhotel.de AXFR
  
 == OpenSuSE 12.3 == == OpenSuSE 12.3 ==
Zeile 339: Zeile 464:
   rcnamed restart   rcnamed restart
   tail /var/log/messages   tail /var/log/messages
-  ls /var/lib/named/slave/{linuxhotel.de,1.168.192.in-addr.arpa} +  ls /var/lib/named/secondary/{linuxhotel.de,1.168.192.in-addr.arpa} 
-  dig @127.0.0.1 linuxhotel.de AXFR+  dig @::1 linuxhotel.de AXFR
  
-==== testen: funktionieren alle verantwortlichen Nameserver? ====+=== testen: funktionieren alle verantwortlichen Nameserver? ===
   dig @141.1.1.1 linuxhotel.de +nssearch   dig @141.1.1.1 linuxhotel.de +nssearch
  
-====== Subdomains delegieren ====== +===== Subdomains delegieren ===== 
-===== Übergeordneter DNS ===== +==== Übergeordneter DNS ==== 
-''/etc/named.conf.local'' : ( Debian 5.0 ) +  * ''/etc/named.conf.local'' : ( Debian ab 5.0 ) 
- +  * ''/etc/named.conf'' : ( CentOS ab 5 )
-''/etc/named.conf'' : ( CentOS 5 )+
 <file> <file>
 zone "linuxhotel.de" IN { zone "linuxhotel.de" IN {
-        type master; +        type primary; 
-        file "master/linuxhotel.de";+        file "linuxhotel.de";
         forwarders      { };         forwarders      { };
 }; };
 </file> </file>
  
-Fallstrick: Unbedingt an forwarders denken! Und **alle** dnssec Optionen ausschalten :!:+:!: Fallstrick: __Unbedingt an **forwarders** denken!__ Und **alle** dnssec Optionen ausschalten :!:
  
-''/var/named/master'' : ( CentOS 5 )+''/var/named'' : ( CentOS 5 )
 <file> <file>
 sub05.linuxhotel.de.        IN NS ns1.sub05.linuxhotel.de. sub05.linuxhotel.de.        IN NS ns1.sub05.linuxhotel.de.
Zeile 370: Zeile 494:
 ''/etc/named.conf.options'' : ( Debian 8 ) ''/etc/named.conf.options'' : ( Debian 8 )
 <file> <file>
-disable-empty-zone "168.192.in-addr-arpa";+disable-empty-zone "168.192.in-addr.arpa";
 </file> </file>
  
 +Das muss auch auf jedem Delegaten konfiguriert werden :!:
  
-  named-checkzone -i local -D linuxhotel.de /var/named/master/linuxhotel.de +  named-checkzone -i local -D linuxhotel.de /var/named/linuxhotel.de 
-===== Subdomain DNS =====+==== Subdomain DNS ====
 Wie oben, unter "eigene Zonen in bind verwalten" Wie oben, unter "eigene Zonen in bind verwalten"
  
-====== Zonendatei für Subnetz per Skript erzeugen ====== +===== Zonendatei für Subnetz per Skript erzeugen ===== 
 <code bash> <code bash>
 #!/bin/bash #!/bin/bash
lpi2/bind.1466605098.txt.gz · Zuletzt geändert: 2016/06/22 14:18 von ingo_wichmann