Bug 54262 - samba-winbind-dnsupdate: Некорректное считывание IPv4-адреса из вывода `dig` при недоступности DC по IPv6
Summary: samba-winbind-dnsupdate: Некорректное считывание IPv4-адреса из вывода `dig` ...
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: samba-winbind-dnsupdate (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Andrey Limachko
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-14 15:42 MSK by Evgeny Shesteperov
Modified: 2025-08-25 16:35 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeny Shesteperov 2025-05-14 15:42:36 MSK
Версия

-   bind-utils-9.18.34-alt1
-   samba-winbind-dnsupdate-0.7.1-alt1

Шаги воспроизведения

1.  Создать Samba-домен, добавить записи PTR для IPv4.

2.  Выполнить:

        # winbind-dnsupdate

Ожидаемый результат: успешное обновление DNS.

Фактический результат: неверно парсится адрес IPv4 в команде dig.

    [INFO]: Hostname: work.samba.testdomain.
    [INFO]: Check winbind status.
    [INFO]: Winbind is running. Continue.
    [INFO]: Trying to get the site name.
    [INFO]: Site: Default-First-Site-Name.
    [INFO]: Get host credentials.
    [INFO]: Retrieving host credentials successfully.
    [INFO]: Trying to get a list of domain controllers in site.
    [INFO]: Success.
    [INFO]: Trying to find an available DNS server.
    [INFO]: Checking the availability of DNS server on dc.samba.testdomain..
    [INFO]: DNS server on dc.samba.testdomain. available.
    [INFO]: Update IPv4.
    [INFO]: Trying to get IPv4 address of a domain controller.
    [INFO]: Successful. DC info:
    [INFO]: Domain controller name: dc.samba.testdomain.
    [INFO]: Domain controller IPv4: refused
    refused
    refused
    <IPv4>.
    [INFO]: Trying parse connection interface name.
    Error: any valid prefix is expected rather than "refused
    refused
    refused
    <IPv4>".
    [WARNING]: Ip route error: .

Вижу проблему в команде dig:

    # dig -t "A" "dc.samba.testdomain" @"dc.samba.testdomain" +short
    ;; communications error to <IPv6>#53: connection refused
    ;; communications error to <IPv6>#53: connection refused
    ;; communications error to <IPv6>#53: connection refused
    <IPv4>
Comment 1 Artem Varaksa 2025-08-06 18:46:27 MSK
Также столкнулся с данной проблемой. Подробнее:


Шаги
====

1. Развернуть Samba DC (ALT Server 11.0 x86_64 minimal).

При этом в /etc/samba/smb.conf:

>    interfaces = <dc-ipv4> 127.0.0.1
>    bind interfaces only = yes

2. Ввести клиентов (ALT Workstation, Workstation K, Education (KDE), Education (XFCE) 11.0 x86_64) с помощью Winbind.

3. На клиенте: # bash -x winbind-dnsupdate


Фактический результат
=====================

Целевой IPv4-адрес (для примера 11.12.13.14) считывается некорректно:

> ++++ dig -t A dc.samba.testdomain @dc.samba.testdomain +short
> +++ out=';; communications error to <dc-ipv6>#53: connection refused
> ;; communications error to <dc-ipv6>#53: timed out
> ;; communications error to <dc-ipv6>#53: connection refused
> 11.12.13.14'
> ++++ awk '-F ' '{print $NF}'
> +++ ip='refused
> out
> refused
> 11.12.13.14'

> [INFO]: Domain controller IPv4: refused
> out
> refused
> 11.12.13.14.
> [INFO]: Trying parse connection interface name.
> +++ ip route get dport 389 'refused
> out
> refused
> 11.12.13.14'
> Error: any valid prefix is expected rather than "refused
> out
> refused
> 11.12.13.14".
> [WARNING]: Ip route error: .
> ++ return 1
> + connect_iface=


Ожидаемый результат
===================

Корректное определение IPv4-адреса вне зависимости от наличия (некритичных) ошибок.


Дополнительно
=============

Было обнаружено в связи с выполнением workaround https://bugzilla.altlinux.org/show_bug.cgi?id=43863#c6, из-за которого DC по IPv6 недоступен (не слушает на нём; слушает только на IPv4).

При этом (см. https://bugzilla.altlinux.org/show_bug.cgi?id=55254#c9) internal DNS Samba DC всё равно отвечает свой IPv6-адрес.

Т. к. выполняется `# dig -t A dc.samba.testdomain @dc.samba.testdomain +short`, то сначала выполняются A/AAAA запросы к настроенному DNS об адресе `dc.samba.testdomain` (исходя из параметра `@dc.samba.testdomain`), откуда он и узнаёт IPv6-адрес DC DNS (в /etc/resolv.conf указан только IPv4), а потом уже по найденным IP-адресам выполняются DC-запросы цели `-t A dc.samba.testdomain`:

> # apt-get install -y tshark
> # tshark -f 'udp port 53'
> Running as user "root" and group "root". This could be dangerous.
> Capturing on 'ens19'
> ^Z
> [1]+  Остановлен    tshark -f 'udp port 53'
> # dig -t A dc.samba.testdomain @dc.samba.testdomain +short
> ;; communications error to <dc-ipv6>#53: connection refused
> ;; communications error to <dc-ipv6>#53: connection refused
> ;; communications error to <dc-ipv6>#53: connection refused
> 11.12.13.14
> # fg
> tshark -f 'udp port 53'
>     1 0.000000000 <client-ipv4> → 11.12.13.14 DNS 79 Standard query 0xece7 A dc.samba.testdomain
>     2 0.000014600 <client-ipv4> → 11.12.13.14 DNS 79 Standard query 0x4dea AAAA dc.samba.testdomain
>     3 0.001841126 11.12.13.14 → <client-ipv4> DNS 154 Standard query response 0x4dea AAAA dc.samba.testdomain AAAA <dc-ipv6> SOA dc.samba.testdomain
>     4 0.001841306 11.12.13.14 → <client-ipv4> DNS 142 Standard query response 0xece7 A dc.samba.testdomain A 11.12.13.14 SOA dc.samba.testdomain
>     5 0.003885318 <client-ipv6> → <dc-ipv6> DNS 122 Standard query 0x320b A dc.samba.testdomain OPT
>     6 0.004676707 <client-ipv6> → <dc-ipv6> DNS 122 Standard query 0x320b A dc.samba.testdomain OPT
>     7 0.004863977 <client-ipv6> → <dc-ipv6> DNS 122 Standard query 0x320b A dc.samba.testdomain OPT
>     8 0.005030542 <client-ipv4> → 11.12.13.14 DNS 102 Standard query 0x320b A dc.samba.testdomain OPT
>     9 0.005480418 11.12.13.14 → <client-ipv4> DNS 142 Standard query response 0x320b A dc.samba.testdomain A 11.12.13.14 SOA dc.samba.testdomain
> ^C9 packets captured

Воспроизводимость
=================

Воспроизводится на виртуальных машинах:

[sisyphus]
samba-4.21.7-alt3.x86_64
bind-utils-9.18.38-alt1.x86_64
samba-winbind-dnsupdate-0.7.1-alt1.noarch

[p11+387440.6]
samba-4.21.7-alt3.x86_64
bind-utils-9.18.37-alt1.x86_64
samba-winbind-dnsupdate-0.7.1-alt1.noarch

[p11]
samba-4.20.8-alt2.x86_64
bind-utils-9.18.37-alt1.x86_64
samba-winbind-dnsupdate-0.7.1-alt1.noarch
Comment 2 Artem Varaksa 2025-08-25 16:35:41 MSK
Недоступность DNS DC по IPv6 также может быть вызвана ошибкой https://bugzilla.altlinux.org/54307, если используется BIND9_DLZ