DNS mit bind9: Unterschied zwischen den Versionen

Aus xinux.net
Zur Navigation springen Zur Suche springen
Zeile 67: Zeile 67:
 
                         NS      ns.vulkan.int.
 
                         NS      ns.vulkan.int.
 
  ns.vulkan.int.          IN      A      192.168.81.21
 
  ns.vulkan.int.          IN      A      192.168.81.21
voyager.int.            IN      A      192.168.81.100
 
borg.int.              IN      A      192.168.81.101
 

Version vom 5. September 2011, 12:10 Uhr

Installation

aptitude install bind9

Konfiguration von bind9

Hauptkonfiguration

Standardmäßig ist die Konfiguration von bind9 auf mehrere Dateien aufgeteilt:

  • /etc/bind/named.conf
  • /etc/bind/named.conf.locale
  • /etc/bind/named.conf.options
  • /etc/bind/named.conf.default-zones

Man kann aber nach belieben auch nur die hauptdatei named.conf benutzen.

Eine Zusammengelegte named.conf sieht so aus:

options {
       directory "/var/lib/bind";
       // forwarders { 0.0.0.0; };
       auth-nxdomain no;    # conform to RFC1035
       listen-on { any; };
};

// prime the server with knowledge of the root servers
zone "." {
       type hint;
       file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
       type master;
       file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
       type master;
       file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
       type master;
       file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
       type master;
       file "/etc/bind/db.255";
};

zone "int" {
       type master;
       file "vulkan";
       notify no;
};

Am unteren Ende beschreiben wir die neue Zone für die unser Nameserver verantwortlich ist.

Zonen Datei

Die Zonendatei enthält die Informationen zu den Adressen, und sieht folgendermaßen aus:

$TTL 300        ; 5 minutes
@                       IN SOA  ns.vulkan.int. technik.xunix.de. (
                               2011090204 ; serial
                               14400      ; refresh (4 hours)
                               3600       ; retry (1 hour)
                               3600000    ; expire (5 weeks 6 days 16 hours)
                               86400      ; minimum (1 day)
                               )
                       NS      ns.vulkan.int.
ns.vulkan.int.          IN      A       192.168.81.21