
Ich möchte die IP meines Servers als DNS festlegen und dann Domänen wie myproject.com, www.myproject.com und *.applications.com auf denselben Server verweisen lassen, auf dem ich diese Dateien in Apache hosten werde.
Ich habe Macports installiert und hier ist meine Konfigurationsdatei: /opt/local/etc/named.conf
// Declares control channels to be used by the rndc utility.
//
// This must be enabled on Mac OS X Server for Server Status to provide valid
// information! (Remove the leading slashes to enable.)
//
// **** STUFF YOU MIGHT NEED TO ENABLE ****
//
controls {
unix "/var/run/ndc" perm 0600 owner 0 group 0;
inet 127.0.0.1 port 54 allow {any; };
};
// It is recommended that 127.0.0.1 be the only address used.
// This also allows non-privileged users on the local host to manage
// your name server.
options {
directory "/opt/local/var/named";
// uncomment the following lines to turn on DNS forwarding,
// and change the forwarind ip address(es) :
//forward first;
//forwarders {
// 123.123.123.123
// 123,123.123.123;
//};
listen-on-v6 { none; };
listen-on { 127.0.0.1; };
// to allow only specific hosts to use the DNS server:
//allow-query {
// 127.0.0.1;
//};
dnssec-validation auto;
pid-file "/opt/local/var/run/named.pid";
};
//
// a caching only nameserver config
zone "." IN {
type hint;
file "db.cache";
};
zone "localhost" IN {
type master;
file "db.localhost";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "db.127.0.0";
allow-update { none; };
};
Ich möchte also in der Lage sein, alle diese Punkte auf demselben Server zu erreichen, auf dem Bind installiert ist:
www.myproject.com
myproject.com
*.applications.com
Wie kann ich das machen? Ich möchte auch fragen, wie ich eine gute Dokumentation oder ein Buch über Bind bekomme. Die Dokumente, die ich im Internet gefunden habe, waren entweder zu technisch oder zu simpel.
Oder gibt es eine einfachere Schnittstelle zum Arbeiten mit Bind?
Antwort1
Sie müssen Ihre named.conf bearbeiten, um eine Zone wie die folgende hinzuzufügen:
zone "myproject.com" IN {
type master;
file "myproject.com.zone";
allow-update { none; };
}
Erstellen Sie dann eine Zonendatei mit /opt/local/var/named
dem Namen myproject.com.zone
. Diese Datei sollte folgendermaßen aussehen:
$ORIGIN myproject.com.
$TTL 21600
@ 3600 SOA <your ns A record>. (
sysadmins.stackoverflow.com. ; address of responsible party
2011072601 ; serial number
3600 ; refresh period
600 ; retry period
604800 ; expire time
60 ) ; minimum ttl
NS <YOUR_NS_A_RECORD>.
A <YOUR_IP>
* IN A <YOUR_IP>
Die Verwendung eines Platzhalters ist Ihre beste Option, da Sie sich dann nicht mehr darum kümmern müssen.
Ich empfehle Ihnen dringend, sich ein Exemplar vonDNS und BIND
Antwort2
Das hat bei mir in der Zonendatei funktioniert. Ich habe in named.conf das verwendet, was Zypher vorgeschlagen hat.
$TTL 10800
myproject.com. IN SOA myservername.myproject.com. admin.mymyproject.com. (
2011071800 ;Serial
86400 ;Refresh
3600 ;Retry
604800 ;Expire
345600 ;Negative caching TTL
)
www.projects.com. IN A <SERVER IP>
projects.com. IN NS myservername.myproject.com.
projects.com. IN A <SERVER IP>
www IN CNAME myproject.com.