DNS-Server einrichten
installieren:
bind9 dnsutils
dann erstmal stoppen und konfigurieren:
sudo /etc/init.d/bind9 stop
- statische IP für den server vergeben
- Konfig-Files liegen in /etc/bind
- bind9 übersicht:
"It is possible to configure the same server to be a caching name server, primary master, and secondary master. A server and be the Start of Authority (SOA) for one zone, while providing secondary service for another zone. All the while providing caching services for hosts on the local LAN." quelle
für einen LAN-Party DNS-Server, der die wichtigesten Anfragen ins LAN umleiten soll:
- caching service ist nicht geeignet. leitet nur weiter an den dns des providers
- secondary master ist nicht nötig
- primary master ist das Ziel.
anzulegen sind forward zone file und reverse zone file
Forward Zone
in /etc/bind/named.conf.local einfügen:
zone "example.com" {
type master;
file "/etc/bind/db.example.de";
};
Datei /etc/bind/db.example.de anlegen:
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA example.de. root.example.de. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS example.de.
@ IN A 192.168.0.77
@ IN AAAA ::1
ns IN A 192.168.0.77
www IN CNAME ns
forum IN CNAME ns
Info:
- root.example.de ist eine Email-Adresse
- die serial muss bei jedem edit erhöht werden
mögliche Einträge, von help.ubuntu.com/8.04/serverguide/C/dns-references.html#dns-record-types
-
A record: This record maps an IP Address to a hostname.
www IN A 192.168.1.12
-
CNAME record: Used to create an alias to an existing A record. You cannot create a CNAME record pointing to another CNAME record.
web IN CNAME www
-
MX record: Used to define where email should be sent to. Must point to an A record, not a CNAME.
IN MX mail.example.com. mail IN A 192.168.1.13 -
NS record: Used to define which servers serve copies of a zone. It must point to an A record, not a CNAME. This is where Primary and Secondary servers are defined.
IN NS ns.example.com. IN NS ns2.example.com. ns IN A 192.168.1.10 ns2 IN A 192.168.1.11
nach dieser Einrichtung muss der DNS bereits funktionieren
starten:
sudo /etc/init.d/bind9 start
Kontrolle in /var/log/syslog
Funktion testen:
dig @127.0.0.1 rechnername.domainname
dig example.de
muss die Infos aus der eben erstellten Datei zurückliefern
Reverse Zone
in /etc/bind/named.conf.local einfügen:
zone "0.168.192.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.192";
};
jetzt die Datei /etc/bind/db.192 erstellen
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA example.de. root.example.de. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.
10 IN PTR example.de.
- die Serial muss bei jedem edit erhöht werden
- Jeder A Record von vorhin benötigt einen PTR Record in dieser Datei.
GUI Konfig:
gadmin-bind9 scheint nicht richtig zu funktionieren, bzw die Dateien an anderen Orten zu suchen
help.ubuntu.com/8.04/serverguide/C/dns.html
http://wiki.ubuntuusers.de/DNS-Server_Bind
http://wiki.ubuntuusers.de/DNS-Server_Bind/Sekund%C3%A4re_Nameserver
http://wiki.ubuntuusers.de/DNS-Server_Bind/Erweiterte_Konfiguration
