Pseudo second level domain Basics: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(23 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
 
=Klonen des Templates=
 
=Klonen des Templates=
 
;Erstellen eines Nameservers laut Plan
 
;Erstellen eines Nameservers laut Plan
;Name ns.it1XX.int
+
;Name ns.it213.int
;Vorläufger DNS ist der 192.168.X.88
+
;Vorläufiger DNS ist der 192.168.X.88
 +
;Der Server ist autoritativ UND rekursiv
  
 
=Installation=
 
=Installation=
*apt install bind9
+
*apt update
 +
*apt install bind9 bind9-utils bind9-dnsutils
 +
 
 
=Auf den Nameservern=
 
=Auf den Nameservern=
;Folgende Option zur /etc/bind/named.conf.options hinzufügen
 
  
 +
==Optionen==
 +
*cat /etc/bind/named.conf.options
 +
<pre>
 +
options {
 +
        directory "/var/cache/bind";
 
         forwarders { 192.168.X.88; };
 
         forwarders { 192.168.X.88; };
 
         empty-zones-enable no;
 
         empty-zones-enable no;
 +
        recursion yes;
 +
        allow-query { any; };
 +
        allow-transfer { 127.0.0.1; };
 +
        dnssec-validation no;
 +
};
 +
</pre>
  
*cat /etc/bind/named.conf.local  
+
==Zonenfestlegung==
 +
*cat /etc/bind/named.conf.local
 
<pre>
 
<pre>
zone it113.int IN {
+
zone "it213.int" IN {
 
     type master;
 
     type master;
     file "it113.int";
+
     file "it213.int";
 
};
 
};
  
zone 113.88.10.in-addr.arpa IN {
+
zone "213.88.10.in-addr.arpa" IN {
 
     type master;
 
     type master;
     file "113.88.10.in-addr.arpa";
+
     file "213.88.10.in-addr.arpa";
 
};
 
};
 
</pre>
 
</pre>
  
 +
=Zonen selbst=
  
*cat /var/cache/bind/it113.int  
+
*cat /var/cache/bind/it213.int
 
<pre>
 
<pre>
 
$TTL 300
 
$TTL 300
@   IN SOA  ns technik.xinux.de. (
+
@           IN SOA  ns.it213.int. technik.xinux.de. (
                         2011090204 ;
+
                         2011090204
                         14400   ;
+
                         14400
                         3600   ;
+
                         3600
                         3600000 ;
+
                         3600000
                         86400   ;
+
                         86400
 
                     )
 
                     )
 
         IN NS      ns
 
         IN NS      ns
ns     IN A      10.88.113.21
+
        IN MX 10  mail
www    IN A      10.88.113.22
+
 
 +
ns       IN A      10.88.213.21
 +
www       IN A      10.88.213.11
 +
mail      IN A      10.88.213.3
 +
fw        IN A      10.88.213.1
 +
proxy     IN A      10.88.213.4
 +
checkmk  IN A      10.88.213.5
 +
revproxy  IN A      10.88.213.41
 +
nextcloud IN A      10.88.213.8
 +
docker    IN A      10.88.213.9
 
</pre>
 
</pre>
  
*cat /var/cache/bind/113.88.10.in-addr.arpa  
+
*cat /var/cache/bind/213.88.10.in-addr.arpa
 
<pre>
 
<pre>
 
 
$TTL 300
 
$TTL 300
@   IN SOA  ns.it113.int. technik.xinux.de. (
+
@           IN SOA  ns.it213.int. technik.xinux.de. (
                         2011090204 ;
+
                         2011090204
                         14400   ;
+
                         14400
                         3600   ;
+
                         3600
                         3600000 ;
+
                         3600000
                         86400   ;
+
                         86400
 
                     )
 
                     )
         IN NS      ns.it113.int.
+
         IN NS      ns.it213.int.
21 IN PTR ns.it113.int.
+
 
22 IN PTR www.it113.int.
+
1      IN PTR    fw.it213.int.
 +
21     IN PTR     ns.it213.int.
 +
11      IN PTR     www.it213.int.
 +
3      IN PTR    mail.it213.int.
 +
4      IN PTR    proxy.it213.int.
 +
5      IN PTR    checkmk.it213.int.
 +
8      IN PTR    nextcloud.it213.int.
 +
9      IN PTR    docker.it213.int.
 +
41      IN PTR    revproxy.it213.int.
 
</pre>
 
</pre>
  
=Handling und Logging=
+
=Server starten=
 
*systemctl restart named
 
*systemctl restart named
*systemctl stop named
+
 
*systemctl start named
+
=Test=
*systemctl is-enabled named
+
==journactl==
 +
;Fortlaufend die letzten 10 Einträge
 
*journalctl -fu named
 
*journalctl -fu named
*journalctl -n 20 -u named
+
;Die letzten 20 Einträge
*journalctl -u named -g it113.int
+
*journalctl -n 20 -u named
 
+
;Grep nach it213.int
=Sind die Zonen ok?=
+
*journalctl -u named -g it213.int
*host -t axfr it113.int 127.0.0.1
+
==dig==
*host -t axfr 113.88.10.in-addr.arpa  127.0.0.1
+
;Forwardlookup eigener Nameserver wird gefragt
 +
*dig @127.0.0.1 -t a www.it213.int
 +
;Welcher Mailserver ist für die Zone zuständig
 +
*dig @127.0.0.1 -t mx it213.int
 +
;Reverse Lookup
 +
*dig @127.0.0.1 -x 10.88.213.21
 +
;Zonen abziehen
 +
*dig @127.0.0.1 -t axfr it213.int  
 +
*dig @127.0.0.1 -t axfr 213.88.10.in-addr.arpa
 +
;Fakeroot Nameserver abfragen
 +
*dig @192.168.9.88 -t a mail.it213.int
 +
=Eigenen Nameserver eintragen=
 +
*cat /etc/resolv.conf
 +
search it213.int
 +
  nameserver 127.0.0.1

Aktuelle Version vom 17. März 2026, 08:06 Uhr

Klonen des Templates

Erstellen eines Nameservers laut Plan
Name ns.it213.int
Vorläufiger DNS ist der 192.168.X.88
Der Server ist autoritativ UND rekursiv

Installation

  • apt update
  • apt install bind9 bind9-utils bind9-dnsutils

Auf den Nameservern

Optionen

  • cat /etc/bind/named.conf.options
options {
        directory "/var/cache/bind";
        forwarders { 192.168.X.88; };
        empty-zones-enable no;
        recursion yes;
        allow-query { any; };
        allow-transfer { 127.0.0.1; };
        dnssec-validation no;
};

Zonenfestlegung

  • cat /etc/bind/named.conf.local
zone "it213.int" IN {
     type master;
     file "it213.int";
};

zone "213.88.10.in-addr.arpa" IN {
     type master;
     file "213.88.10.in-addr.arpa";
};

Zonen selbst

  • cat /var/cache/bind/it213.int
$TTL 300
@           IN SOA  ns.it213.int. technik.xinux.de. (
                        2011090204
                        14400
                        3600
                        3600000
                        86400
                    )
        IN NS      ns
        IN MX 10   mail

ns        IN A       10.88.213.21
www       IN A       10.88.213.11
mail      IN A       10.88.213.3
fw        IN A       10.88.213.1
proxy     IN A       10.88.213.4
checkmk   IN A       10.88.213.5
revproxy  IN A       10.88.213.41
nextcloud IN A       10.88.213.8
docker    IN A       10.88.213.9
  • cat /var/cache/bind/213.88.10.in-addr.arpa
$TTL 300
@           IN SOA  ns.it213.int. technik.xinux.de. (
                        2011090204
                        14400
                        3600
                        3600000
                        86400
                    )
        IN NS      ns.it213.int.

1       IN PTR     fw.it213.int.
21      IN PTR     ns.it213.int.
11      IN PTR     www.it213.int.
3       IN PTR     mail.it213.int.
4       IN PTR     proxy.it213.int.
5       IN PTR     checkmk.it213.int.
8       IN PTR     nextcloud.it213.int.
9       IN PTR     docker.it213.int.
41      IN PTR     revproxy.it213.int.

Server starten

  • systemctl restart named

Test

journactl

Fortlaufend die letzten 10 Einträge
  • journalctl -fu named
Die letzten 20 Einträge
  • journalctl -n 20 -u named
Grep nach it213.int
  • journalctl -u named -g it213.int

dig

Forwardlookup eigener Nameserver wird gefragt
  • dig @127.0.0.1 -t a www.it213.int
Welcher Mailserver ist für die Zone zuständig
  • dig @127.0.0.1 -t mx it213.int
Reverse Lookup
  • dig @127.0.0.1 -x 10.88.213.21
Zonen abziehen
  • dig @127.0.0.1 -t axfr it213.int
  • dig @127.0.0.1 -t axfr 213.88.10.in-addr.arpa
Fakeroot Nameserver abfragen
  • dig @192.168.9.88 -t a mail.it213.int

Eigenen Nameserver eintragen

  • cat /etc/resolv.conf
search it213.int
nameserver 127.0.0.1