Raspberrypi.dns: Unterschied zwischen den Versionen

Aus OrgaMon Wiki
Zur Navigation springen Zur Suche springen
 
(21 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
  apt-get install bind9-doc bind9 dnsutils
  apt install bind9-doc bind9 dnsutils
 
== Hostname dieses Nameservers ==
 
* In den Dateien verwende ich <code><b>pins</b></code> als Hostname für diesen Nameserver
 
== Uhrzeit-Problem ==
 
* Der Rapsberry Pi hat keine Hardware-Uhr, das ist bei bind9 problematisch, da DNS-Server im Internet befragt werden und dazu zeitabhängige Schlüssel verwendet werden
* Ist die Uhrzeit hierbei falsch (zum Beispiel nach einem 3 stündigen Stromausfall) wird sich also der lokale DNS Server weigern Antworten aus dem Internet zu akzeptieren, der Dienst fällt dann für das lokale Netz aus
* Somit sollte man per ntp !!!OHNE NAMENSAUFLÖSUNG!!! einen Zeitserver kontaktieren und erst mal die Uhr stellen, dann kann man den bind9 starten
 
* ... die muss noch erledigt werden
   
   
== /etc/resolv.conf ==
== /etc/resolv.conf ==


  # Generated by resolvconf
* Lokale DNS Anfragen soll der eigene Server beantworten
 
  #  
# Ich bin Nameserver
#
nameserver 127.0.0.1
  domain lummerland
  domain lummerland
  #nameserver 192.168.115.25
  search lummerland
nameserver 192.168.115.46
== /etc/network/interfaces ==


# interfaces(5) file used by ifup(8) and ifdown(8)
* Ev. die Datei durch attrib +i resolv.conf vor überschreiben schützen
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto eth0
iface eth0 inet static
  address 192.168.115.46
  netmask 255.255.255.0
  gateway 192.168.115.115


== /etc/bind/named.conf.options ==  
== /etc/bind/named.conf.options ==  
Zeile 39: Zeile 41:
   
   
         forwarders {
         forwarders {
                 192.168.115.115; 192.168.115.116;  
                 1.1.1.1;  
         };
         };
   
   
Zeile 97: Zeile 99:




== /etc/bind/db.lummerland ==
$TTL 2D
@  IN SOA  pins.lummerland.  root.lummerland. (
          2016020313 ; serial
          2D        ; refresh
          4H        ; retry
          6W        ; expiry
          1W  )    ; minimum
@            IN NS  pins.lummerland.
localhost    IN A    127.0.0.1
server        IN A    192.168.115.1
*.server      IN A    192.168.115.1
fritzbox7490  IN A    192.168.115.95
repeater      IN A    192.168.115.114
gateway      IN A    192.168.115.115
router        IN A    192.168.115.116
== /etc/bind/db.115.168.192 ==
$TTL 2D
@  IN SOA  pins.lummerland. root.lummerland. (
            2016020313 ; serial
            2D        ; refresh
            4H      ; retry
            6W      ; expire
            1W  )  ; minimum
@  IN NS    pins.lummerland.
1  IN PTR    server.lummerland.
114 IN PTR    repeater.lummerland.
115 IN PTR    gateway.lummerland.
116 IN PTR    router.lummerland.
;
; 200 bis 249 ist reserviert fuer freies DHCP
;


== /etc/bind/db.orgamon.org ==
== /etc/bind/db.orgamon.org ==
Zeile 116: Zeile 157:
== /etc/bind/db.orgamon.eu ==
== /etc/bind/db.orgamon.eu ==
== /etc/bind/db.orgamon.net ==
== /etc/bind/db.orgamon.net ==
== /etc/bind/db.orgamon.com ==
== Rechte ==
== Rechte ==


Zeile 127: Zeile 166:
  resolvconf -l
  resolvconf -l


apt install dnsutils
  dig @pi3x00 orgamon.org
  dig @pi3x00 orgamon.org

Aktuelle Version vom 14. Juni 2023, 12:17 Uhr

apt install bind9-doc bind9 dnsutils

Hostname dieses Nameservers

  • In den Dateien verwende ich pins als Hostname für diesen Nameserver

Uhrzeit-Problem

  • Der Rapsberry Pi hat keine Hardware-Uhr, das ist bei bind9 problematisch, da DNS-Server im Internet befragt werden und dazu zeitabhängige Schlüssel verwendet werden
  • Ist die Uhrzeit hierbei falsch (zum Beispiel nach einem 3 stündigen Stromausfall) wird sich also der lokale DNS Server weigern Antworten aus dem Internet zu akzeptieren, der Dienst fällt dann für das lokale Netz aus
  • Somit sollte man per ntp !!!OHNE NAMENSAUFLÖSUNG!!! einen Zeitserver kontaktieren und erst mal die Uhr stellen, dann kann man den bind9 starten
  • ... die muss noch erledigt werden

/etc/resolv.conf

  • Lokale DNS Anfragen soll der eigene Server beantworten
# 
# Ich bin Nameserver
#
nameserver 127.0.0.1
domain lummerland
search lummerland
  • Ev. die Datei durch attrib +i resolv.conf vor überschreiben schützen

/etc/bind/named.conf.options

options {
       directory "/var/cache/bind";

       // If there is a firewall between you and nameservers you want
       // to talk to, you may need to fix the firewall to allow multiple
       // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

       // If your ISP provided one or more IP addresses for stable 
       // nameservers, you probably want to use them as forwarders.  
       // Uncomment the following block, and insert the addresses replacing 
       // the all-0's placeholder.

       forwarders {
               1.1.1.1; 
       };

       notify no;

       //========================================================================
       // If BIND logs error messages about the root key being expired,
       // you will need to update your keys.  See https://www.isc.org/bind-keys
       //========================================================================
       dnssec-validation auto;

       auth-nxdomain no;    # conform to RFC1035
       listen-on-v6 { any; };
};

/etc/bind/named.conf.local

//
// Do any local configuration here
//

zone "lummerland" in { 
 type master; 
 file "/etc/bind/db.lummerland"; 
};

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

zone "orgamon.org." {
 type master;
 file "/etc/bind/db.orgamon.org";
};

zone "orgamon.de." {
 type master;
 file "/etc/bind/db.orgamon.de";
}; 

zone "orgamon.net." {
 type master;
 file "/etc/bind/db.orgamon.net";
};

zone "orgamon.eu." {
 type master;
 file "/etc/bind/db.orgamon.eu";
};



// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";


/etc/bind/db.lummerland

$TTL 2D
@  IN SOA  pins.lummerland.   root.lummerland. (
          2016020313 ; serial
          2D         ; refresh
          4H         ; retry
          6W         ; expiry
          1W  )     ; minimum

@             IN NS   pins.lummerland.

localhost     IN A    127.0.0.1
server        IN A    192.168.115.1
*.server      IN A    192.168.115.1
fritzbox7490  IN A    192.168.115.95
repeater      IN A    192.168.115.114
gateway       IN A    192.168.115.115
router        IN A    192.168.115.116

/etc/bind/db.115.168.192

$TTL 2D
@   IN SOA  pins.lummerland. root.lummerland. (
           2016020313 ; serial
           2D        ; refresh
           4H       ; retry
           6W       ; expire
           1W  )   ; minimum

@   IN NS     pins.lummerland.
1   IN PTR    server.lummerland.
114 IN PTR    repeater.lummerland.
115 IN PTR    gateway.lummerland.
116 IN PTR    router.lummerland.
;
; 200 bis 249 ist reserviert fuer freies DHCP
;

/etc/bind/db.orgamon.org

$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              5         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.
orgamon.org.    IN     A       192.168.115.25
*.orgamon.org.  IN     A       192.168.115.25
@       IN      MX     10  mx.orgamon.eu.

/etc/bind/db.orgamon.de

/etc/bind/db.orgamon.eu

/etc/bind/db.orgamon.net

Rechte

chmod 644 db.*
systemctl start bind9

Test

resolvconf -l
apt install dnsutils
dig @pi3x00 orgamon.org