2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-21 23:28:19 +00:00
Commit Graph

133 Commits

Author SHA1 Message Date
Vinícius Ferrão d01cb679eb fix(dhcp): share SHA-256 key policy in FIPS mode 2026-10-05 22:52:34 -03:00
Daniel Hilst 6a41acf2db fix(xcat-core): the retried DNS update carries two TSIG records
makedns reports "error was FORMERR" for an update that named rejected with
NOTAUTH. The FORMERR is the answer to the retry, not to the first attempt.

send_ddns_update in ddns.pm signs the packet the caller built, and signs that
same packet again on each attempt. Net::DNS::Packet::sign_tsig appends the TSIG
to the additional section, so the second attempt sends two TSIG records and
named answers FORMERR. FORMERR is neither NOTAUTH nor SERVFAIL, so the routine
stops and reports it. The NOTAUTH and SERVFAIL retry can never be accepted, on
any algorithm.

Each attempt now signs a request of its own. A packet cannot be unsigned again,
so ddns_update_request copies the prerequisite and update records into a new
Net::DNS::Update instead, and the caller keeps the unsigned original.

ddns_update_retry.t fails before this change: the second attempt carries two
TSIG records, and an update that the retry answers with NOERROR still reports
failure.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-15 20:43:58 -03:00
Daniel Hilst 4eb9718548 fix(xcat-core): makedns rewrites its own TSIG key and then fails against it
makedns exits 1 on a management node that has Net::DNS below 1.36 and an
hmac-sha256 key, and reports "Failure encountered updating <zone> with entry
'', error was FORMERR".

update_namedconf in ddns.pm rewrites the named.conf key stanza to hmac-md5
whenever Net::DNS is below 1.36, and ddns_tsig_algorithm returns hmac-md5 for
the same reason. ddns_sign_update signs with site.dhcpomapialgorithm, which
xcatconfig sets to hmac-sha256 on EL9 and later. named matches a TSIG key by
name and by algorithm, so it answers NOTAUTH. The retry signs the same packet
a second time, and named answers FORMERR to the two signatures.

The version test protected the two-argument sign_tsig($name, $secret), which
produces an HMAC-MD5 signature only. ddns_sign_update signs every other
algorithm through a KEY RR, so the Net::DNS version no longer selects the
algorithm. This change deletes the rewrite and the version test, and signs with
the algorithm the key stanza declares. OmapiPolicy->algorithm_rr_type maps that
algorithm to its KEY RR number.

ddns_named_key_algorithm.t fails before this change: it reads the stanza as
hmac-md5 where the key was hmac-sha256.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-15 20:43:58 -03:00
Vinícius Ferrão 5bfbc8edf6 Merge pull request #7627 from VersatusHPC/fix/ddns-net-dns-version-comparison
refactor(ddns): centralize Net::DNS version policy
2026-07-23 17:44:30 -03:00
Vinícius Ferrão 34241f680f Merge pull request #7633 from VersatusHPC/harvest/ddns-routed-local-address
fix(ddns): recognize a routed local nameserver address
2026-07-23 17:10:16 -03:00
Daniel Hilst 9dd025bf05 fix(ddns): retry transient DNS-update rejections and fail on persistent ones
ddns.pm's DNS-update send has a 3-try retry loop, but it only retried on
NOTAUTH and -- on the final attempt -- the `next` fell out of the loop without
reporting failure. makedns then printed "Completed updating DNS records." and
"DNS setup is completed" even when the update was never accepted.

Two problems this causes:
- SERVFAIL was never retried. named routinely replies SERVFAIL transiently
  right after a zone (re)load, before the zone is ready to accept dynamic
  updates; the update succeeds a second or two later. This reliably breaks real
  flat-cluster provisioning on el9/el10, where the test case's makedns -n runs
  right after named reloads the zone with the new compute node.
- A persistent NOTAUTH/SERVFAIL (retries exhausted) was silently swallowed and
  reported as success, so a genuinely failed DNS update looked like it worked.

Extract the batch send into send_ddns_update(), which retries NOTAUTH and
SERVFAIL (pausing on SERVFAIL), returns 0 only on NOERROR, and otherwise emits
the error and returns 1. Both batch-send sites now `return 1 if
send_ddns_update(...)`, so a real failure aborts add_or_delete_records instead
of falsely reporting success.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-07-23 11:34:50 -03:00
Vinícius Ferrão a0dfc3343a fix(ddns): recognize a routed local nameserver address
The DNS-managed-networks check used my_ip_facing($net->{net}), which only
returns local addresses on the interface directly facing that network. A
nameserver that is a local address reachable via a different (routed)
interface was therefore treated as external, and the network was wrongly
dropped from ddns management.

Use thishostisnot(), which recognizes any local address regardless of the
interface, and keep the existing <xcatmaster> and site-nameserver special
cases.

Recovered from the unmerged lenovobuild branch (original 3c343f83), adapted
to preserve those special cases: lab validation showed the original replaced
them wholesale, which would exclude any network whose nameserver is the
literal <xcatmaster> token (thishostisnot('<xcatmaster>') is true).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-22 19:41:28 -03:00
Vinícius Ferrão ad9ac6db8a refactor(ddns): centralize Net::DNS version policy 2026-07-22 01:55:59 -03:00
Daniel Hilst 638f0d75c4 Fix xCAT 2.18 EL10 x86_64 package build issues
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-06-20 18:48:14 -03:00
Vinícius Ferrão ab86139959 Support configurable ISC OMAPI TSIG policy
Add a shared OMAPI policy helper for ISC DHCP and DDNS so administrators can select the key name, signing algorithm, and omshell path from the site table while preserving the existing xcat_key hmac-md5 default.

Keep local ISC updates from hanging indefinitely when omshell does not exit, and use a static host-declaration fallback for local Ubuntu ISC releases where omshell is unstable for xCAT host updates.

Co-authored-by: gskouson <1507929+gskouson@users.noreply.github.com>
2026-05-07 03:57:10 -03:00
Vinícius Ferrão 1babd7b0e4 fix: improve Ubuntu LTS provisioning support 2026-04-29 18:19:12 -03:00
Daniel Hilst Selli 42d23c7d92 fix: Fix regresion in makedns in update mode
Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2026-03-20 13:26:46 -03:00
Daniel Hilst Selli 54742d7d57 fix: Fix makedns for Net::DNS >= 1.36 and bind >= 9.18 2025-11-27 12:12:03 -03:00
Daniel Hilst Selli 3cb359e711 feat: Add support for RHEL 10
Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2025-11-26 16:07:19 -03:00
Wai Yee Wong 786d271c5f remove use version 2023-01-27 10:26:19 -05:00
Wai Yee Wong 457da8b073 Use xCAT::Utils:CheckVersion to compare BIND versions without using the version.pm 2023-01-26 21:16:55 -05:00
Markus Hilger 1d44787f17 Properly parse newer BIND versions
Previous solution did not work for releases > 9.16.9 (ex. 9.16.10)
Furthermore, EL9 adds -RH tag at the end (ex. 9.16.23-RH) which needs to
be removed.
2022-10-12 16:02:35 +02:00
Mark Gurevich dc0d43750d Turn off DNSSEC on Management Node for bind 9.16.6 2022-03-18 14:11:50 -04:00
bybai c7145b61a1 improved 2019-04-22 05:00:58 -04:00
bybai 17748beb53 change /var/named permission to default 0750 2019-04-19 06:49:41 -04:00
Yuan Bai 59c1630e76 add dnsforwardmode for makedns (#5970)
* add forwardmode for makedns

* polished

* polished

* update site table man doc

* polished

* polished
2019-01-24 14:36:35 +08:00
GONG Jie 5b246ef602 Remove trailing spaces in file xCAT-server/lib/xcat/plugins/ddns.pm 2017-12-31 23:59:59 +00:00
Ryan Bowen a75baf8215 Add check for leading zeroes in ip address when running makedns
This adds a check for the presence of leading zeroes in any octet of IPv4 addresses for which DNS entries will be created.
2018-07-10 12:14:08 -04:00
Kilian Cavalotti 2419a78098 ddns: log more infornation to show the DNS entry when an error occurs 2018-04-11 15:29:52 -07:00
bybai 55fed03a81 handle error 2018-01-18 03:01:45 -05:00
bybai 7f7c4e4dea enhance print error message 2018-01-18 02:36:31 -05:00
bybai df3eb6c4f4 change empty_zones_enable in named.conf 2018-01-18 01:44:29 -05:00
Yuan Bai b3e235583f Merge pull request #4552 from stanford-rc/named_includes
Check if the include line is already there before adding it to the file
2017-12-20 11:21:39 +08:00
Kilian Cavalotti a920f94804 check if the include line is already there before adding it to the file 2017-12-18 11:54:30 -08:00
Yuan Bai 71c80b6155 Merge pull request #4393 from stanford-rc/dns_slave
ddns.pm: specify the "directory" option for DNS slaves too
2017-12-14 14:48:12 +08:00
Yuan Bai c5f11bd7e3 Merge pull request #4497 from stanford-rc/named_includes
Crude attempt at including external configuration files in named.conf
2017-12-13 11:28:44 +08:00
Kilian Cavalotti 3d8bc4980b Crude attempt at including external configuration files in named.conf 2017-12-12 10:46:56 -08:00
Kilian Cavalotti d12631dbd5 ddns.pm: specify the "directory" option for DNS slaves too (cf. bug #4392) 2017-11-29 14:22:52 -08:00
Bin Xu d9ab5b7558 Fix #3082, to avoid named is started twice in short time. (#3388) 2017-07-04 02:03:11 -05:00
bybai 74babfcede fix issue 2572 makedns fails with a noderange error 2017-03-01 22:13:51 -05:00
bybai 204b78bf86 makedns add redundant message in /etc/named.conf 2377 2017-01-09 04:12:08 -05:00
bybai 25de1b0129 polish it 2017-01-05 21:16:10 -05:00
bybai fcc08f1e13 polish it 2017-01-04 21:11:34 -05:00
bybai 9432dbb5c8 fix 2206 add comments in /etc/named.conf indicating that it is generated by xCAT 2017-01-04 02:18:32 -05:00
Kilian Cavalotti fd90ff371b ddns.pm: fix condition to append domainname to hostname
Fix an issue where the domainname was not appended to the hostname
when the domainname was contained in a substring of the hostname.
Update the regular expression to make sure it only check for the
domainname at the end of the hostname string.
2016-11-08 15:27:45 -08:00
bybai eedf5d7069 polished the ddns.pm based on comments 2016-08-30 22:33:21 -04:00
bybai 12773c44fc fix issue 1553 makedns failed when input invalid hostname into /etc/hosts 2016-08-25 01:52:19 -04:00
Mark Gurevich 0a3fbd8d51 perltidy all perl files 2016-07-20 11:40:27 -04:00
WangXiaoPeng 5ba0427b48 fix a typo that perl sentence: continue does not work in sles11.4 2016-06-21 02:56:18 -04:00
wangxiaopeng 7fa07c687e issue 1191: do retry when update dns record replies NOTAUTH 2016-06-15 10:13:06 -04:00
penguhyang 4b8dcabe27 fix #1057, there are error messages when upgrading xcat on ubuntu 2016-05-09 05:19:55 -04:00
XuWei f2b9f6e94a to fix Issue 302, modified my_ip_facing and related functions 2015-11-12 00:33:03 -05:00
daniceexi 06f4eca23b defect 4490: In ddns.pm, to udpate all the NS server in the zone file 2014-12-23 09:03:49 -05:00
daniceexi 77d46e97cc defect 3969: support return multiple ips for networkUtils->my_ip_facing() 2014-12-23 06:59:00 -05:00
Casandra Qiu 2d1961c4f9 bug#4286 makedns should have a verbose mode 2014-11-12 10:24:38 -05:00