titux
Goto Top

Bind9 Konfig-Problem

Hallo,

ich habe hier auf einer physischen Maschine ein CentOS 7.1 mit bind9 installiert, der Dienst läuft, der Check für die named.conf und der Zonencheck laufen beide ohne Fehler durch. Ich habe noch keine Reverse-Lookup Zone angelegt, da ich erst schauen wollte,
ob die Forward-Zone funktioniert. Wenn ich jetzt z.B. von einem Debian Client aus versuche, einen Hostnahmen aufzulösen, schlägt das fehl.

Hier meine named.conf

[root@centi named]# cat /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { none; };
        directory       "/var/named";  
        dump-file       "/var/named/data/cache_dump.db";  
        statistics-file "/var/named/data/named_stats.txt";  
        memstatistics-file "/var/named/data/named_mem_stats.txt";  
        allow-query     { localhost; };

        /*
         - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
         - If you are building a RECURSIVE (caching) DNS server, you need to enable
           recursion.
         - If your recursive DNS server has a public IP address, you MUST enable access
           control to limit queries to your legitimate users. Failing to do so will
           cause your server to become part of large scale DNS amplification
           attacks. Implementing BCP38 within your network would greatly
           reduce such attack surface
        */
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";  

        managed-keys-directory "/var/named/dynamic";  

        pid-file "/run/named/named.pid";  
        session-keyfile "/run/named/session.key";  
};

logging {
        channel default_debug {
                file "data/named.run";  
                severity dynamic;
        };
};

zone "." IN {  
        type hint;
        file "named.ca";  
};

zone "invenient.test" {  
        type master;
        file "db.invenient.test";  
};



include "/etc/named.rfc1912.zones";  
include "/etc/named.root.key";  

Und hier meine db.invenient.test

[root@centi named]# cat /var/named/db.invenient.test
$TTL 3600
@        IN     SOA     centi.invenient.test.   test.invenient.test. (
                        2015042301      ; Serial
                        12h             ; Refresh
                        1h              ; Retry
                        10d             ; Expire
                        1h              ; Negative Cache TTL
                        )

                IN      NS      centi.invenient.test.
                IN      NS      ns6.kasserver.com.

                IN      MX      10      centi

centi           IN      A       192.168.100.30
debian          IN      A       192.168.100.238

Es befinden sich nur 2 A Records in der Zone, ein Debian Client mit der .238 und der DNS-Server selber (Glue-Record) mit seiner .30 IP.
Gehe ich jetzt auf einen anderen Client u. versuche den Debian Host über DNS aufzulösen, kann er den DNS-Server nicht erreichen. Hier das Ergebnis vom Client:

root@lap1:~# dig @192.168.100.30 debian

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> @192.168.100.30 debian
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

So sieht die resolv.conf aus:

root@lap1:~# cat /etc/resolv.conf
domain invenient.test
search invenient.test
nameserver 192.168.100.30
nameserver 192.168.100.254

Iptaples ist auf dem DNS Server nicht gestartet, ich bekomme jedenfalls das Ergebnis:

[root@centi ~]# service iptables status
Redirecting to /bin/systemctl status  iptables.service
iptables.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

Wenn ich von einem Client aus allerdings per nmap den DNS-Server scanne, erscheint der DNS-Dienst dort nicht, dass wundert mich.

Wenn der DNS-Server selber eine Hostabfage mit dig macht, funktioniert das ganze:

[root@centi ~]# dig @localhost debian

; <<>> DiG 9.9.4-RedHat-9.9.4-18.el7_1.1 <<>> @localhost debian
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 26811
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;debian.                                IN      A

;; AUTHORITY SECTION:
.                       10748   IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2015042201 1800 900 604800 86400

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Do Apr 23 12:31:01 CEST 2015
;; MSG SIZE  rcvd: 110

Welchen Fehler habe ich da noch drin, ich komme einfach nicht weiter, wer kann mir bitte helfen?

Gruß
TiTux

Content-Key: 270019

Url: https://administrator.de/contentid/270019

Printed on: April 19, 2024 at 20:04 o'clock

Mitglied: 114757
114757 Apr 23, 2015 updated at 11:32:11 (UTC)
Goto Top
Moin,
Wenn der DNS-Server selber eine Hostabfage mit dig macht, funktioniert das ganze:
Nein das tut es dort ebenfalls nicht, dieser Output zeug ebenfalls davon das es nicht klappt, siehst du an der Meldung NXDOMAIN und ANSWER: 0 !
Als "Status" muss dort stehen NOERROR.

  • Wurde bind nach den Änderungen neu gestartet ?
  • Was sagt das syslog nach dem Start von bind "/var/log/syslog" ?

ändere mal die Nameserver-Zeile im Zonenfile
invenient.test.   IN      NS      centi.invenient.test.
invenient.test.   IN      A      192.168.100.30
http://askubuntu.com/questions/330148/how-do-i-do-a-complete-bind9-dns- ...

Gruß jodel32
Member: AndiEoh
AndiEoh Apr 23, 2015 at 12:17:32 (UTC)
Goto Top
Hallo,

auf den Bind Server:

- was sagt "netstat -a -n"? Ist dort port 53 auf der IPv4 Adresse als "listen" gelistet

- was sagt "iptables -L -v"? Soweit ich weiß ist iptables kein Service/Daemon

Gruß

Andi
Member: TiTux
TiTux Apr 23, 2015 at 12:23:19 (UTC)
Goto Top
Ich habe die Einträge angepasst, keine Veränderung. Das @ Zeichen bezieht sich doch auf alle Einträge in der Konfigdatei, deswegen muss ich den Domain-Namen doch eigentlich nicht mehr davor setzen? So habe ich das jedenfalls gelesen.

Hier die Ausgabe von Syslog, wenn nach bind/named gesucht wird:

09:36:11,257 INFO kernel:[    0.306312] TCP bind hash table entries: 32768 (order: 7, 524288 bytes)
09:36:11,257 INFO kernel:[    0.306664] TCP: Hash tables configured (established 32768 bind 32768)

09:36:11,258 INFO kernel:[   17.827239] RPC: Registered named UNIX socket transport module.
Member: TiTux
TiTux Apr 23, 2015 at 12:37:57 (UTC)
Goto Top
[root@centi ~]# netstat -tulpen
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       Benutzer   Inode      PID/Program name
tcp        0      0 192.168.100.30:53       0.0.0.0:*               LISTEN      25         22082      2470/named
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      25         22080      2470/named
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          18386      1089/sshd
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      25         21476      2470/named
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      0          20669      1786/master
tcp6       0      0 :::22                   :::*                    LISTEN      0          18388      1089/sshd
tcp6       0      0 ::1:953                 :::*                    LISTEN      25         21477      2470/named
tcp6       0      0 ::1:25                  :::*                    LISTEN      0          20670      1786/master
udp        0      0 0.0.0.0:51203           0.0.0.0:*                           70         16774      610/avahi-daemon: r
udp        0      0 192.168.100.30:53       0.0.0.0:*                           25         22081      2470/named
udp        0      0 127.0.0.1:53            0.0.0.0:*                           25         22079      2470/named
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           70         16773      610/avahi-daemon: r

und iptables sagt:

Chain FWDI_public (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 FWDI_public_log  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDI_public_deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDI_public_allow  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain FWDI_public_allow (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDI_public_deny (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDI_public_log (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDO_public (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 FWDO_public_log  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDO_public_deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDO_public_allow  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain FWDO_public_allow (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDO_public_deny (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDO_public_log (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain INPUT_ZONES (1 references)
 pkts bytes target     prot opt in     out     source               destination
   68  8746 IN_public  all  --  enp0s25 *       0.0.0.0/0            0.0.0.0/0           [goto]
    0     0 IN_public  all  --  +      *       0.0.0.0/0            0.0.0.0/0           [goto]

Chain INPUT_ZONES_SOURCE (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain INPUT_direct (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain IN_public (2 references)
 pkts bytes target     prot opt in     out     source               destination
   68  8746 IN_public_log  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   68  8746 IN_public_deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   68  8746 IN_public_allow  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain IN_public_allow (1 references)
 pkts bytes target     prot opt in     out     source               destination
    1    52 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22 ctstate NEW

Chain IN_public_deny (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain IN_public_log (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT_direct (1 references)
 pkts bytes target     prot opt in     out     source               destination
[root@centi ~]# clear
[root@centi ~]# iptables -L -v -n
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  523 45200 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
   11   741 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
   68  8746 INPUT_direct  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   68  8746 INPUT_ZONES_SOURCE  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   68  8746 INPUT_ZONES  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
   67  8694 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
    0     0 FORWARD_direct  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FORWARD_IN_ZONES_SOURCE  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FORWARD_IN_ZONES  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FORWARD_OUT_ZONES_SOURCE  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FORWARD_OUT_ZONES  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT 668 packets, 132K bytes)
 pkts bytes target     prot opt in     out     source               destination
  668  132K OUTPUT_direct  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain FORWARD_IN_ZONES (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 FWDI_public  all  --  enp0s25 *       0.0.0.0/0            0.0.0.0/0           [goto]
    0     0 FWDI_public  all  --  +      *       0.0.0.0/0            0.0.0.0/0           [goto]

Chain FORWARD_IN_ZONES_SOURCE (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD_OUT_ZONES (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 FWDO_public  all  --  *      enp0s25  0.0.0.0/0            0.0.0.0/0           [goto]
    0     0 FWDO_public  all  --  *      +       0.0.0.0/0            0.0.0.0/0           [goto]

Chain FORWARD_OUT_ZONES_SOURCE (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD_direct (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDI_public (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 FWDI_public_log  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDI_public_deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDI_public_allow  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain FWDI_public_allow (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDI_public_deny (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDI_public_log (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDO_public (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 FWDO_public_log  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDO_public_deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDO_public_allow  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain FWDO_public_allow (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDO_public_deny (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDO_public_log (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain INPUT_ZONES (1 references)
 pkts bytes target     prot opt in     out     source               destination
   68  8746 IN_public  all  --  enp0s25 *       0.0.0.0/0            0.0.0.0/0           [goto]
    0     0 IN_public  all  --  +      *       0.0.0.0/0            0.0.0.0/0           [goto]

Chain INPUT_ZONES_SOURCE (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain INPUT_direct (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain IN_public (2 references)
 pkts bytes target     prot opt in     out     source               destination
   68  8746 IN_public_log  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   68  8746 IN_public_deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   68  8746 IN_public_allow  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain IN_public_allow (1 references)
 pkts bytes target     prot opt in     out     source               destination
    1    52 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22 ctstate NEW

Chain IN_public_deny (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain IN_public_log (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT_direct (1 references)
 pkts bytes target     prot opt in     out     source               destination
[root@centi ~]# iptables -L -v -n
[root@centi ~]# iptables -L -v -n
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  549 46592 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
   11   741 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
   68  8746 INPUT_direct  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   68  8746 INPUT_ZONES_SOURCE  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   68  8746 INPUT_ZONES  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
   67  8694 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
    0     0 FORWARD_direct  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FORWARD_IN_ZONES_SOURCE  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FORWARD_IN_ZONES  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FORWARD_OUT_ZONES_SOURCE  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FORWARD_OUT_ZONES  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT 709 packets, 142K bytes)
 pkts bytes target     prot opt in     out     source               destination
  709  142K OUTPUT_direct  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain FORWARD_IN_ZONES (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 FWDI_public  all  --  enp0s25 *       0.0.0.0/0            0.0.0.0/0           [goto]
    0     0 FWDI_public  all  --  +      *       0.0.0.0/0            0.0.0.0/0           [goto]

Chain FORWARD_IN_ZONES_SOURCE (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD_OUT_ZONES (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 FWDO_public  all  --  *      enp0s25  0.0.0.0/0            0.0.0.0/0           [goto]
    0     0 FWDO_public  all  --  *      +       0.0.0.0/0            0.0.0.0/0           [goto]

Chain FORWARD_OUT_ZONES_SOURCE (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD_direct (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDI_public (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 FWDI_public_log  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDI_public_deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDI_public_allow  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain FWDI_public_allow (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDI_public_deny (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDI_public_log (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDO_public (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 FWDO_public_log  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDO_public_deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 FWDO_public_allow  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain FWDO_public_allow (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDO_public_deny (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain FWDO_public_log (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain INPUT_ZONES (1 references)
 pkts bytes target     prot opt in     out     source               destination
   68  8746 IN_public  all  --  enp0s25 *       0.0.0.0/0            0.0.0.0/0           [goto]
    0     0 IN_public  all  --  +      *       0.0.0.0/0            0.0.0.0/0           [goto]

Chain INPUT_ZONES_SOURCE (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain INPUT_direct (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain IN_public (2 references)
 pkts bytes target     prot opt in     out     source               destination
   68  8746 IN_public_log  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   68  8746 IN_public_deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0
   68  8746 IN_public_allow  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain IN_public_allow (1 references)
 pkts bytes target     prot opt in     out     source               destination
    1    52 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22 ctstate NEW

Chain IN_public_deny (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain IN_public_log (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT_direct (1 references)
 pkts bytes target     prot opt in     out     source               destination
Member: AndiEoh
AndiEoh Apr 23, 2015 at 12:52:19 (UTC)
Goto Top
Aha, da ist also eine ganze Menge "iptables" aktiv. Du solltest die aus der CentOS Dokumentation raussuchen wie die Firewall anzupassen ist. Auf die schnelle ist nämlich nur SSH als Ausnahme zu finden, für DNS brauchst du aber noch Port 53 eingehend für UDP und TCP.

Gruß

Andi
Mitglied: 114757
114757 Apr 23, 2015 updated at 13:10:35 (UTC)
Goto Top
Jup da ist die Firewall dicht ...schalte also Port 53 (UDP/TCP) frei
Member: TiTux
TiTux Apr 23, 2015 at 14:16:33 (UTC)
Goto Top
Sodele, ab CentOS 7 ist "firewalld" standardmäßig aktiviert, kannte ich vorher überhaupt nicht. Iptables war gar nicht aktiv. Okay, firewalld habe ich nun deaktiviert und iptables aktiviert und die Regel hinzugefügt. Das war auf jedenfall schon mal der erste Fehler. Mit nmap wird mir jetzt auch der Port 53 als offen angezeigt, ein kleiner Erfolg.

Aber die dig Abfrage funktioniert immer noch nicht, auch nicht auf dem DNS-Server selber.

[root@centi ~]# dig @localhost centi

; <<>> DiG 9.9.4-RedHat-9.9.4-18.el7_1.1 <<>> @localhost centi
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 12266
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;centi.                         IN      A

;; AUTHORITY SECTION:
.                       1723    IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2015042300 1800 900 604800 86400

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Do Apr 23 16:12:36 CEST 2015
;; MSG SIZE  rcvd: 109

Wenn ich einen öffentlichen Server abfrage, funktioniert es, hierfür wird er die Anfrage wohl an den zweiten DNS Server (Router IP) weiterreichen.

[root@centi ~]# dig @localhost www.heise.de

; <<>> DiG 9.9.4-RedHat-9.9.4-18.el7_1.1 <<>> @localhost www.heise.de
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40643
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.heise.de.                  IN      A

;; ANSWER SECTION:
www.heise.de.           2831    IN      A       193.99.144.85

;; AUTHORITY SECTION:
.                       934     IN      NS      c.root-servers.net.
.                       934     IN      NS      h.root-servers.net.
.                       934     IN      NS      i.root-servers.net.
.                       934     IN      NS      b.root-servers.net.
.                       934     IN      NS      l.root-servers.net.
.                       934     IN      NS      f.root-servers.net.
.                       934     IN      NS      j.root-servers.net.
.                       934     IN      NS      e.root-servers.net.
.                       934     IN      NS      k.root-servers.net.
.                       934     IN      NS      d.root-servers.net.
.                       934     IN      NS      g.root-servers.net.
.                       934     IN      NS      a.root-servers.net.
.                       934     IN      NS      m.root-servers.net.

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Do Apr 23 16:14:14 CEST 2015
;; MSG SIZE  rcvd: 268

An der Konfig hat sich sonst nichts geändert, noch eine Idee?
Member: AndiEoh
Solution AndiEoh Apr 23, 2015, updated at Apr 24, 2015 at 11:05:35 (UTC)
Goto Top
1. "dig" verwendet standardmäßig keine Suchdomain aus resolv.conf. Also entweder "dig @192.168.100.30 debian.invenient.test A" oder die +search option verwenden.

2. allow-query { localhost; }; muss natürlich auch angepasst werden, guckst du hier: http://wiki.ubuntuusers.de/DNS-Server_Bind/Erweiterte_Konfiguration

3. Falls Bind nicht als resolver cache arbeiten soll auch "recursive no;" setzen, falls er beides tun soll (was nicht empfohlen ist) "allow-recursion { <dein internes netz>; }"; verwenden.

Gruß

Andi
Member: TiTux
TiTux Apr 24, 2015 at 11:05:02 (UTC)
Goto Top
Hi Andi,

Vielen Dank! Der zweite Punkt, allow-query anzupassen, hat den Fehler endlich behoben. Mich wundert es nur, dass ich das in keinem meiner Bücher gefunden habe, dort wird diese Optione komplett aussen vor gelassen, deshalb wusste ich auch nicht, dass ich den noch anpassen muss, da ich dachte, localhost wird wohl in der Standardeinstellung passen. Auch auf anderen Blogs/Foren Seiten ist der meistens nicht aufgetaucht.

Kannst Du mir noch kurz erklären, was jetzt genau die Optione "recursive no" in Kombination mit allow-recursion macht?

Also derzeit soll der Server wirklich nur lokal im Netz als autorativer Server für seinen eigene Zone fungieren und mit dem Internet nichts am Hut haben.

Danke
TiTux
Member: AndiEoh
AndiEoh Apr 25, 2015 at 13:26:08 (UTC)
Goto Top
Hallo,

Bind kann beides DNS-Server und (caching) Resolver. Das erste bedeutet er ist der Master für eine oder mehrere Domains und beantwortet nur direkte Anfragen, als Resolver hingegen gräbt er sich auch rekursiv durch den DNS Baum. Das zweite will man üblicherweise nicht für alle Clients freigeben, da damit DoS Attacken möglich werden. Der Parameter "recursive no;" schaltet den Resolver part ab, allow-query ist recht neu bzw. der Default ist meine ich "all", deshalb taucht es in vielen Büchern noch nicht auf.

Gruß

Andi
Member: TiTux
TiTux Apr 25, 2015 at 13:57:46 (UTC)
Goto Top
Okay, so hatte ich das auch selber verstanden. Unter CentOS ist dieser Wert standardmäßig auf Localhost, was die Sache halt
etwas erschwert hat, aber jetzt geht ja alles.

Danke Dir uns ein schönes Wochenende

TiTux