Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
fortgeschrittene:bind [2024/08/08 04:31] ingo_wichmann [Konfigurationsdatei] |
fortgeschrittene:bind [2025/08/14 06:43] (aktuell) ingo_wichmann |
||
---|---|---|---|
Zeile 14: | Zeile 14: | ||
options { | options { | ||
… | … | ||
- | // In der Praxis ist DNSSEC eine gute Sache ... aber zum Lernen erst mal aus: | + | // In der Praxis ist DNSSEC eine gute Sache ... aber im Intranet zum Lernen erst mal aus: |
dnssec-validation no; | dnssec-validation no; | ||
… | … | ||
Zeile 41: | Zeile 41: | ||
=== Zonendatei === | === Zonendatei === | ||
- | * ''/var/named/linuxhotel.de'' : ( CentOS ab 5 ) | + | * ''/var/named/linuxhotel.de'' : ( CentOS ) |
- | * ''/var/lib/named/linuxhotel.de'' : ( SuSE ab 10.0) | + | * ''/var/lib/named/linuxhotel.de'' : ( SuSE ) |
- | * ''/var/cache/bind/linuxhotel.de'' : ( Debian ab 3.1 ) | + | * ''/var/cache/bind/linuxhotel.de'' : ( Debian ) |
<file txt linuxhotel.de> | <file txt linuxhotel.de> | ||
Zeile 65: | Zeile 65: | ||
notebook06.linuxhotel.de. A 192.168.1.206 | notebook06.linuxhotel.de. A 192.168.1.206 | ||
notebook09.linuxhotel.de. 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: | ||
Zeile 75: | Zeile 81: | ||
=== Zonendatei überprüfen === | === Zonendatei überprüfen === | ||
- | == CentOS (ab 5) == | + | == CentOS == |
named-checkzone -D linuxhotel.de. /var/named/linuxhotel.de | named-checkzone -D linuxhotel.de. /var/named/linuxhotel.de | ||
- | == SuSE (ab 10.0) == | + | == SuSE == |
named-checkzone -D linuxhotel.de. /var/lib/named/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/linuxhotel.de | named-checkzone -D linuxhotel.de. /var/cache/bind/linuxhotel.de | ||
- | ==== Konfigurationsdatei ==== | + | === Konfigurationsdatei === |
- | * ''/etc/named.conf'' : ( SuSE 10.2 ) | + | * ''/etc/named.conf'' : ( SuSE ) |
- | * ''/etc/named.conf'' : ( CentOS ab 5 ) | + | * ''/etc/named.conf'' : ( CentOS ) |
- | * ''/etc/bind/named.conf.local'' : ( Debian ab 5.0 ) | + | * ''/etc/bind/named.conf.local'' : ( Debian ) |
<file> | <file> | ||
zone "linuxhotel.de" { | zone "linuxhotel.de" { | ||
Zeile 100: | Zeile 106: | ||
=== bind die Änderung mitteilen === | === bind die Änderung mitteilen === | ||
rndc reconfig | rndc reconfig | ||
- | oder | + | ((oder |
- | openSuSE, centos (ab 7) | + | openSuSE, CentOS |
service named reload | service named reload | ||
- | Debian (ab 6) | + | Debian |
service bind9 reload | service bind9 reload | ||
+ | )) | ||
=== im Log prüfen, ob es Fehler gab === | === im Log prüfen, ob es Fehler gab === | ||
- | Debian (ab 11) | + | Debian |
journalctl -eu named.service | journalctl -eu named.service | ||
- | ==== testen ==== | + | === testen === |
- | host peter.linuxhotel.de 127.0.0.1 | + | host peter.linuxhotel.de ::1 |
- | dig peter.linuxhotel.de @127.0.0.1 any | + | 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 | ||
- | @ SOA notebook20 root.notebook20 1999022301 1d 2h 5w 2d | + | @ SOA notebook20.linuxhotel.de. root.notebook20.linuxhotel.de. 1999022301 1d 2h 5w 2d |
; Nameserver: | ; Nameserver: | ||
- | NS notebook20 | + | NS notebook20.linuxhotel.de. |
; kanonische IP-Adressen: | ; kanonische IP-Adressen: | ||
notebook22 A 192.168.1.222 | notebook22 A 192.168.1.222 | ||
+ | AAAA 2a0f:6480:1:600::222 | ||
notebook05 A 192.168.1.205 | notebook05 A 192.168.1.205 | ||
+ | AAAA 2a0f:6480:1:600::205 | ||
notebook20 A 192.168.1.220 | notebook20 A 192.168.1.220 | ||
+ | AAAA 2a0f:6480:1:600::220 | ||
notebook06 A 192.168.1.206 | notebook06 A 192.168.1.206 | ||
+ | AAAA 2a0f:6480:1:600::206 | ||
notebook09 A 192.168.1.209 | notebook09 A 192.168.1.209 | ||
+ | AAAA 2a0f:6480:1:600::209 | ||
; Aliase: | ; Aliase: | ||
Zeile 167: | Zeile 178: | ||
rndc reload linuxhotel.de | rndc reload linuxhotel.de | ||
- | ==== Rückwärts-Zone ==== | + | ==== Rückwärts-Zone IPv4 ==== |
=== Zonendatei === | === Zonendatei === | ||
* ''/var/named/1.168.192.in-addr.arpa'': ( CentOS ) | * ''/var/named/1.168.192.in-addr.arpa'': ( CentOS ) | ||
Zeile 175: | Zeile 186: | ||
<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 | ||
Zeile 194: | Zeile 200: | ||
=== testen === | === testen === | ||
- | == CentOS (ab 5) == | + | == CentOS == |
- | named-checkzone -D linuxhotel.de. /var/named/linuxhotel.de | + | |
named-checkzone -D 1.168.192.in-addr.arpa. /var/named/1.168.192.in-addr.arpa | named-checkzone -D 1.168.192.in-addr.arpa. /var/named/1.168.192.in-addr.arpa | ||
- | == SuSE (ab 10.0) == | + | == SuSE == |
- | named-checkzone -D linuxhotel.de. /var/lib/named/linuxhotel.de | + | |
named-checkzone -D 1.168.192.in-addr.arpa. /var/lib/named/1.168.192.in-addr.arpa | named-checkzone -D 1.168.192.in-addr.arpa. /var/lib/named/1.168.192.in-addr.arpa | ||
- | == Debian (ab 3.1) == | + | == Debian == |
- | named-checkzone -D linuxhotel.de. /var/cache/bind/linuxhotel.de | + | |
named-checkzone -D 1.168.192.in-addr.arpa. /var/cache/bind/1.168.192.in-addr.arpa | named-checkzone -D 1.168.192.in-addr.arpa. /var/cache/bind/1.168.192.in-addr.arpa | ||
=== Konfigurationsdatei === | === Konfigurationsdatei === | ||
- | ''/etc/named.conf'' : ( SuSE 10.2 ) | + | * ''/etc/named.conf'' : ( SuSE 10.2 ) |
- | + | * ''/etc/named.conf'' : ( CentOS ) | |
- | ''/etc/named.conf'' : ( CentOS ) | + | * ''/etc/bind/named.conf.local'' : ( Debian 3.1 ) |
- | + | ||
- | ''/etc/bind/named.conf.local'' : ( Debian 3.1 ) | + | |
<file> | <file> | ||
zone "1.168.192.in-addr.arpa" { | zone "1.168.192.in-addr.arpa" { | ||
Zeile 224: | Zeile 225: | ||
rndc reconfig | rndc reconfig | ||
=== testen === | === testen === | ||
- | host 192.168.1.222 127.0.0.1 | + | host 192.168.1.222 ::1 |
- | dig -x 192.168.1.222 @127.0.0.1 | + | dig -x 192.168.1.222 @::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> | ||
+ | $TTL 2h | ||
+ | @ SOA notebook20.linuxhotel.de. root.notebook20.linuxhotel.de. 1999022301 1d 2h 5w 2d | ||
+ | |||
+ | ; Nameserver: | ||
+ | NS notebook20.linuxhotel.de. | ||
+ | |||
+ | ; kanonische IP-Adressen | ||
+ | 2.0.5.0.0.0.0.0.0.0.0.0.0.0.0.0. IN PTR notebook05.linuxhotel.de. | ||
+ | 2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0. IN PTR notebook20.linuxhotel.de. | ||
+ | 2.0.6.0.0.0.0.0.0.0.0.0.0.0.0.0. IN PTR notebook06.linuxhotel.de. | ||
+ | 2.0.9.0.0.0.0.0.0.0.0.0.0.0.0.0. IN PTR notebook09.linuxhotel.de. | ||
+ | 2.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0. IN PTR notebook22.linuxhotel.de. | ||
+ | </file> | ||
+ | |||
+ | === testen === | ||
+ | == CentOS == | ||
+ | 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 | ||
+ | |||
+ | == SuSE == | ||
+ | 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 | ||
+ | |||
+ | === Konfigurationsdatei === | ||
+ | * ''/etc/named.conf'' : ( SuSE ) | ||
+ | * ''/etc/named.conf'' : ( CentOS ) | ||
+ | * ''/etc/bind/named.conf.local'' : ( Debian ) | ||
+ | <file> | ||
+ | zone "0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa" { | ||
+ | type primary; | ||
+ | file "0.0.6.0.1.0.0.0.0.8.4.6.f.0.a.2.ip6.arpa"; | ||
+ | }; | ||
+ | </file> | ||
+ | == Syntax der Konfigurationsdatei prüfen == | ||
+ | named-checkconf -z | ||
+ | |||
+ | == bind die Änderung mitteilen == | ||
+ | rndc reconfig | ||
+ | === testen === | ||
+ | host 2a0f:6480:1:600::222 ::1 | ||
+ | dig -x 2a0f:6480:1:600::222 @::1 | ||
===== Zonendateien mit nsupdate bearbeiten ===== | ===== Zonendateien mit nsupdate bearbeiten ===== | ||
Zeile 334: | Zeile 388: | ||
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 == | == debian 8 == | ||
Zeile 340: | Zeile 394: | ||
rndc reload linuxhotel.de | rndc reload linuxhotel.de | ||
journalctl -eu bind9 | journalctl -eu bind9 | ||
- | dig @127.0.0.1 linuxhotel.de NS | + | dig @::1 linuxhotel.de NS |
==== Secondary konfigurieren ==== | ==== Secondary konfigurieren ==== | ||
Zeile 364: | Zeile 418: | ||
</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" { | ||
Zeile 403: | Zeile 456: | ||
journalctl -eu bind9 | journalctl -eu bind9 | ||
ls /var/cache/bind/secondary/{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 410: | Zeile 463: | ||
tail /var/log/messages | tail /var/log/messages | ||
ls /var/lib/named/secondary/{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? === | ||
Zeile 417: | Zeile 470: | ||
===== Subdomains delegieren ===== | ===== Subdomains delegieren ===== | ||
==== Übergeordneter DNS ==== | ==== Übergeordneter DNS ==== | ||
- | ''/etc/named.conf.local'' : ( Debian ab 5.0 ) | + | * ''/etc/named.conf.local'' : ( Debian ab 5.0 ) |
- | + | * ''/etc/named.conf'' : ( CentOS ab 5 ) | |
- | ''/etc/named.conf'' : ( CentOS ab 5 ) | + | |
<file> | <file> | ||
zone "linuxhotel.de" IN { | zone "linuxhotel.de" IN { |