opsec2022
Goto Top

Samba AD-DC DNSTroubleshooting

Hallo,

ich habe einen Samba Server als AD DC mit Shares eingerichtet und an diesen einige Clients angebunden. Dazu einen 2. der Domäne gejoined.
Nach Problemen mit der resolv.conf, hat es mir nach einem neu start anscheinend etwas zerschossen und ich finde die Problematik nicht.
gemappte Netzlaufwerke außerhalb der Domäne entfernt es mit der Meldung, dass keine Authentifizierung aufgrund des DCs möglich sei.
smbstatus zeigt mir garnichts an. Es ist somit kein Verzeichnisdienst verfügbar. Clients können sich schleppend Cached anmelden.
Ich bezweifle dass das etwas mit dem 2. DC zutun hat, er ist bis dato lediglich gejoint. Ich verstehe auch nicht wieso hier im Bereich global der dc02 primärer dns ist.
Jedenfalls lässt sich die Domäne nicht auflösen. Ich vermute ich verstehe Systemd_resolved und die resolv.conf komplett falsch.

Der DC Antwortet auf hostname Ping mit einer Ipv6 Adresse.

IPs wurden hier durch hostnames ersetzt
Auf den Clients ist der DC natürlich als primärer dns konfiguriert.

Log:

  /usr/sbin/samba_dnsupdate:     timeout = self._compute_timeout(start, lifetime)
[2022/04/14 11:01:44.338740,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate:   File "/usr/lib/python3/dist-packages/dns/resolver.py", line 799, in _compute_timeout  
[2022/04/14 11:01:44.338805,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate:     raise Timeout(timeout=duration)
[2022/04/14 11:01:44.338837,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate: dns.exception.Timeout: The DNS operation timed out after 15.002166986465454 seconds
[2022/04/14 11:01:44.338867,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate:
[2022/04/14 11:01:44.338886,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate: During handling of the above exception, another exception occurred:
[2022/04/14 11:01:44.338901,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate:
[2022/04/14 11:01:44.338915,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate: Traceback (most recent call last):
[2022/04/14 11:01:44.338928,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate:   File "/usr/sbin/samba_dnsupdate", line 848, in <module>  
[2022/04/14 11:01:44.338953,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate:     elif not check_dns_name(d):
[2022/04/14 11:01:44.338970,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate:   File "/usr/sbin/samba_dnsupdate", line 300, in check_dns_name  
[2022/04/14 11:01:44.339070,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate:     raise Exception("Timeout while waiting to contact a working DNS server while looking for %s as %s" % (d, normalised_name))  
[2022/04/14 11:01:44.339101,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_handler)
  /usr/sbin/samba_dnsupdate: Exception: Timeout while waiting to contact a working DNS server while looking for A dc01.my.domain 192.168.XX.XX as dc01.my.domain.
[2022/04/14 11:01:44.357617,  0] ../../source4/dsdb/dns/dns_update.c:85(dnsupdate_nameupdate_done)
  dnsupdate_nameupdate_done: Failed DNS update with exit code 1

liegt hier ein record quer?
$host -t SRV _ldap._tcp.my.domain.
no servers could be reached



resolvectl status

Global
         Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
  resolv.conf mode: foreign
Current DNS Server: dc02
       DNS Servers: dc02
        DNS Domain: MY

Link 2 (eno1)
Current Scopes: DNS
     Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
   DNS Servers: dc01 dc02
Link 3 (eno2)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

resolv.conf

nameserver dc01, dc02
search MY

netplan dc01

network:
    version: 2
    renderer: networkd
    ethernets:
        eno1:
            addresses:
                - dc01/24
            nameservers:
                addresses: [dc02, dc01, router]
            routes:
                - to: default
                  via: router

Welche Infos fehlen?
Hat hier jemand eine Idee/ sieht den Fehler ??

Gruß

OpSec

Content-Key: 2499044871

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

Printed on: April 23, 2024 at 15:04 o'clock

Member: linuxer1
linuxer1 Apr 14, 2022 at 09:57:27 (UTC)
Goto Top
servus OpSec,

stammen die logs vom dc01, dc02
wo läuft der dns ?
welcher dns samba-intern oder bind ?

host: parse of /etc/resolv.conf failed
mal die resolve.conf kontrolliert auf schreibfehler ?

rudimentäre resolve.conf f. dc01

search my.domain
nameserver dc02
nameserver 127.0.0.1

Gruss
l
Member: opsec2022
opsec2022 Apr 14, 2022 updated at 10:17:40 (UTC)
Goto Top
Zitat von @linuxer1:

servus OpSec,
Hallo und vielen Dank erstmal
stammen die logs vom dc01, dc02
wo läuft der dns ?
welcher dns samba-intern oder bind ?
dc01, samba-intern

der dc02

host: parse of /etc/resolv.conf failed
mal die resolve.conf kontrolliert auf schreibfehler ?

ja und korrigiert, nun

no servers could be reached

rudimentäre resolve.conf f. dc01

search my.domain
nameserver dc02
nameserver 127.0.0.1

Gruss
l
Habe die resolv.conf nun mit
nameserver $dc01
nameserver $dc02
search my.domain versorgt.

Brauch der Dc01 nicht einen upstream dns z.b den router?
Es scheint einmal ein schreibfehler in der resolv.conf gewesen zu sein. Trotzdessen ist der Verzeichnisdienst nicht erreichbar. Ich kann nicht rauslesen wo genau mein Fehler liegt

Gruß

OpSec
Member: linuxer1
linuxer1 Apr 14, 2022 at 11:01:25 (UTC)
Goto Top
ich gehe davon aus das bei $dc... das "$" nur ein Platzhalter hier für das Forum ist, und nicht so in der conf steht, bitte mit der IP in der conf arbeiten

wenn samba intern, in der smb.conf sollte eine Zeile
dns forwarder = ...
stehen , wenn nicht, trag mal die ip vom router ein.

was sagt ein dig $dc01 @$dc01 und ein dig $dc01 @$dc02

Gruss
l
Member: NordicMike
NordicMike Apr 14, 2022 at 11:15:11 (UTC)
Goto Top
nameservers:
addresses: [dc02, dc01, router]

Wenn der Router als Nameserver mit angegeben wird, muss der Router auch die Anfragen an die Domäne an die zwei Nameserver weiterleiten.
Member: opsec2022
opsec2022 Apr 14, 2022 at 11:18:03 (UTC)
Goto Top
Zitat von @linuxer1:

ich gehe davon aus das bei $dc... das "$" nur ein Platzhalter hier für das Forum ist, und nicht so in der conf steht, bitte mit der IP in der conf arbeiten
richtig, typo.
wenn samba intern, in der smb.conf sollte eine Zeile
dns forwarder = ...
stehen , wenn nicht, trag mal die ip vom router ein.
Hier steht google und das ist evtl. mein Problem
was sagt ein dig $dc01 @$dc01 und ein dig $dc01 @$dc02
Beides
; <<>> DiG 9.16.15-Ubuntu <<>>
;; global options: +cmd
;; connection timed out; no servers could be reached
Auch das Wiki Troubleshooting half mir nichts einzugrenzen.
Gruss
l

Gruß OpSec
Member: linuxer1
linuxer1 Apr 14, 2022 at 11:18:48 (UTC)
Goto Top
btw.: hier noch ein gutes "tut" fuer die Einbindung eines 2. DC

https://wiki.samba.org/index.php/Joining_a_Samba_DC_to_an_Existing_Activ ...
Member: linuxer1
linuxer1 Apr 14, 2022 at 11:24:21 (UTC)
Goto Top
wie sieht die Netzwerkkonfig aus ?

Ip
netmask
gateway

was sagt "ping $dc01" von $dc02 / "ping dc$02" von $dc01 ?
können andere Maschinen von den $dc[0|1]erreicht werden per ip ?

sieht für mich nach grundsätzlichem Konfigurations-Problem des Netzwerkes aus.

vg
l
Member: opsec2022
opsec2022 Apr 14, 2022 updated at 12:20:21 (UTC)
Goto Top
Hallo,

Zitat von @NordicMike:

nameservers:
addresses: [dc02, dc01, router]

Wenn der Router als Nameserver mit angegeben wird, muss der Router auch die Anfragen an die Domäne an die zwei Nameserver weiterleiten.

Inwiefern gilt die netplan config denn in kombination mit der resolv.conf noch?
Hier blicke ich mittlerweile nicht mehr richtig durch. Das ganze mündete anscheinend aus der Problematik mit der resolv.conf.


Zitat von @linuxer1:

wie sieht die Netzwerkkonfig aus ?

Ip
netmask
gateway

was sagt "ping $dc01" von $dc02 / "ping dc$02" von $dc01 ?
können andere Maschinen von den $dc[0|1]erreicht werden per ip ?

sieht für mich nach grundsätzlichem Konfigurations-Problem des Netzwerkes aus.

vg
l

Clients können sich anmelden, ziehen die cached gpos, nur an den hinterlegten credentials für mapped drives hapert es. Auch dns forwarder > router hat nichts geändert. Mit den RSAT Tools natürlich auch keine Verbindung mehr

Also:

Router 192.168.0.1
DC1 192.168.0.10
DC2 192.168.0.100 # Bitte vernachlässigen

  • Krb5.conf ist korrekt
  • Ping DCs IP geht visca versa durch
  • Beim Hostname ping kriegen beide direkt dc0%.my.domain hinten dran

  • Hostname Ping von Client außerhalb der Domäne = ipv6 response
  • Hostname Ping von Client innerhalb der Domäne = schleppende ipv6 response
  • Ping IP von Client sowohl als auch Dom member = geht durch

resolv.conf

nameserver 192.168.0.100
nameserver 127.0.0.1
search MY

ip addr

eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 0c:c4:7a:XX:XX:XX brd ff:ff:ff:ff:ff:ff
    altname enp1s0
    inet 192.168.0.10/24 brd 192.168.0.255 scope global eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::%%%%%%%/64 scope link
       valid_lft forever preferred_lft forever

Netzwerk config

network:
    version: 2
    renderer: networkd
    ethernets:
        eno1:
            addresses:
                - 192.168.0.10/24
            nameservers:
                addresses: [192.168.0.10, 192.168.0.100]
            routes:
                - to: default
                  via: 192.168.0.1
resolvectl
Global
         Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
  resolv.conf mode: foreign
Current DNS Server: 192.168.0.1
       DNS Servers: 192.168.0.1 192.168.0.10 192.168.0.100
        DNS Domain: MY

Link 2 (eno1)
Current Scopes: DNS
     Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
   DNS Servers: 192.168.0.10 192.168.0.100

Link 3 (eno2)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

smb.conf

[global]
        min protocol = NT1
        dns forwarder = 192.168.0.1
        netbios name = DC01
        realm = MY.DOMAIN
        server role = active directory domain controller
        workgroup = MY
        idmap_ldb:use rfc2307 = yes

        map to guest = Bad User
        log file = /var/log/samba/%m
        log level = 3

template shell = /bin/bash
winbind use default domain = true
winbind offline logon = false
winbind nss info = rfc2307

        winbind enum users = yes
        winbind enum groups = yes

[sysvol]
        path = /var/lib/samba/sysvol
        read only = No

[netlogon]
        path = /var/lib/samba/sysvol/my.domain/scripts
        read only = No
....

Gruß

OpSec
Member: linuxer1
linuxer1 Apr 14, 2022 at 13:00:29 (UTC)
Goto Top
was sagt "nftables" bzw "iptables -L" ?
ist hier evtl etwas gesetzt

dig no servers can be reached heisst ja einfach, er kann keinen fragen
entweder weil die ip nicht erreichbar ist oder der Dienst nicht antwortet / läuft

was passiert denn, wenn der 2. DC offline / aus ist ?
Member: opsec2022
opsec2022 Apr 14, 2022 at 13:00:32 (UTC)
Goto Top
Log Einträge wie bisher

[2022/04/14 14:51:46.110762,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate: Traceback (most recent call last):
[2022/04/14 14:51:46.110843,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:   File "/usr/sbin/samba_dnsupdate", line 298, in check_d>  
[2022/04/14 14:51:46.110877,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:     ans = check_one_dns_name(normalised_name, d.type, d)
[2022/04/14 14:51:46.110895,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:   File "/usr/sbin/samba_dnsupdate", line 275, in check_o>  
[2022/04/14 14:51:46.110912,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:     return resolver.resolve(name, name_type)
[2022/04/14 14:51:46.110928,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:   File "/usr/lib/python3/dist-packages/dns/resolver.py",>  
[2022/04/14 14:51:46.110998,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:     timeout = self._compute_timeout(start, lifetime)
[2022/04/14 14:51:46.111020,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:   File "/usr/lib/python3/dist-packages/dns/resolver.py",>  
[2022/04/14 14:51:46.111106,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:     raise Timeout(timeout=duration)
[2022/04/14 14:51:46.111130,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate: dns.exception.Timeout: The DNS operation timed out after>
[2022/04/14 14:51:46.111157,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:
[2022/04/14 14:51:46.111177,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate: During handling of the above exception, another exceptio>
[2022/04/14 14:51:46.111192,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:
[2022/04/14 14:51:46.111214,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate: Traceback (most recent call last):
[2022/04/14 14:51:46.111228,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:   File "/usr/sbin/samba_dnsupdate", line 848, in <module>  
[2022/04/14 14:51:46.111245,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:     elif not check_dns_name(d):
[2022/04/14 14:51:46.111260,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:   File "/usr/sbin/samba_dnsupdate", line 300, in check_d>  
[2022/04/14 14:51:46.111299,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate:     raise Exception("Timeout while waiting to contact a >  
[2022/04/14 14:51:46.111318,  0] ../../lib/util/util_runcmd.c:352(samba_runcmd_io_han>
  /usr/sbin/samba_dnsupdate: Exception: Timeout while waiting to contact a working DN>
[2022/04/14 14:51:46.129766,  0] ../../source4/dsdb/dns/dns_update.c:85(dnsupdate_nam>
  dnsupdate_nameupdate_done: Failed DNS update with exit code 1
Member: opsec2022
opsec2022 Apr 14, 2022 updated at 13:08:54 (UTC)
Goto Top
Zitat von @linuxer1:

was sagt "nftables" bzw "iptables -L" ?
ist hier evtl etwas gesetzt


Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination


dig no servers can be reached heisst ja einfach, er kann keinen fragen
entweder weil die ip nicht erreichbar ist oder der Dienst nicht antwortet / läuft

was passiert denn, wenn der 2. DC offline / aus ist ?

Dann verliert jeder client der ihn als secondary eingetragen hat komplett die konnektivität. Umkehrschluss DNS dc01
Auf den dc02 baue ich auch nicht, da keine sysvol replikation besteht und relevante Infos auf dc01 liegen. Ich bin der Meinung er ist hier außen vor.

Wahrscheinlich werde ich alle Profile zurück migrieren, relevante Dinge sichern, frisch aufsetzen und alles von Vorne ordentlich konfigurieren.
Member: linuxer1
linuxer1 Apr 14, 2022 at 14:03:38 (UTC)
Goto Top
das hört sich nach samba auf $dc01 - problem an

ps -faux | grep samba auf $dc01 sagt was ?

journalctl -u samba-ad-dc

nmap -sS $dc01 | grep 445

klist -k

jeweils auf $dc01
Member: opsec2022
opsec2022 Apr 14, 2022 at 18:06:37 (UTC)
Goto Top
Zitat von @linuxer1:
Erstmal vielen herzlichen Dank für die Unterstützung.
das hört sich nach samba auf $dc01 - problem an
Genau. Zum Erfolg führte es schlussendlich den Systemd resolved Service zu stoppen und disablen nach händischem bearbeiten der Resolv.conf und einem neu start steht der dc nun wieder. Wahrscheinlich waren deine Fragen nur nicht zielführend, weil die gegebenen Informationen spärlich waren.

Schönes Wochenende

Gruß

OpSec
Member: commodity
commodity Apr 15, 2022 at 17:07:19 (UTC)
Goto Top
Zitat von @opsec2022:
... Zum Erfolg führte es schlussendlich den Systemd resolved Service zu stoppen
Was ganz vorn in "Preparing the Installation" in den Docs dazu steht face-wink :

https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory ...
screenshot 2022-04-15 190136

Leider zu spät gesehen, aber Du hast es ja gefunden face-smile

Viele Grüße, commodity