Bug 15326 - net ads dns register will fail in multiple interfaces/subnet enviorment.
Summary: net ads dns register will fail in multiple interfaces/subnet enviorment.
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-07 06:27 UTC by HY Wu
Modified: 2023-03-08 06:17 UTC (History)
0 users

See Also:


Attachments
patch (4.13 KB, text/plain)
2023-03-07 06:43 UTC, HY Wu
no flags Details
patch (3.19 KB, patch)
2023-03-08 05:38 UTC, HY Wu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description HY Wu 2023-03-07 06:27:45 UTC
net ads dns register command will register/update DNS record at DNS.
If DNS policy is round robin, you may get different IP address between dyanmic
update and TKEY query in multiple interfaces/subnets connection enviroment.
Running dynamic update and TEKY query in different interfaces/subnets may causes
DNS dynamic update to fail.

Both dynamic update and TEKY query run getaddrinfo() then they may get different address.

Example:

 |samba box |---10.77.x.x--|Windows 2008r2 DC/DNS|
 |          |---10.88.x.x--|   dc.testdom.com    |

answer to 1st nslookup dc.testdom.com:
name:   dc.testdom.com
answer: 10.77.1.1
name:   dc.testdom.com
answer: 10.88.1.1

answer to 2nd nslookup dc.testdom.com:
name:   dc.testdom.com
answer: 10.88.1.1
name:   dc.testdom.com
answer: 10.77.1.1

dynamic update connect to 10.77.1.1 and TKEY query connect to 10.88.1.1 then fail to update. I don't know what happen in windows DNS.

To aviod this situation, we can run getaddrinfo() only once then pass connectinfo to TKEY query funtion.

patch will follow.
Comment 1 HY Wu 2023-03-07 06:43:25 UTC
Created attachment 17796 [details]
patch
Comment 2 HY Wu 2023-03-08 05:38:28 UTC
Created attachment 17797 [details]
patch
Comment 4 HY Wu 2023-03-08 06:17:33 UTC
(In reply to HY Wu from comment #3)
sorry for error patch link.
https://gitlab.com/hywu/samba/-/commit/acdae18d2c7fcf7eeca70bf3df1489b11ab4e641