diff --git a/docs/ced-network-operations.md b/docs/ced-network-operations.md index d96572b..45446c9 100644 --- a/docs/ced-network-operations.md +++ b/docs/ced-network-operations.md @@ -293,6 +293,46 @@ On LCI-77, restore the saved Wi-Fi suffix and remove only the NRPT rule with the comment `CED domain DNS for local administrator Wi-Fi`. Keep the domain GPO and unrelated DNS rules. These DNS changes require no router apply or radio restart. +#### Sala Inmersiva to SGU-DC02 name resolution + +The reverse direction needed an additional change: Sala's original router DNS +at `192.168.55.1` returned NXDOMAIN for both `SGU-DC02` and its FQDN. Guest Network +Pro now assigns **192.168.54.211** as Sala Inmersiva's DHCP DNS server. This change +keeps its SSID, authentication, VLAN 54, and gateway `192.168.55.1`. Applying it +briefly restarted the radios; a temporary reconnection task protected SGU-DC02 +and was removed after verifying server access. CED, Invitados CED, and Esports CED +were visible again after a fresh wireless scan. LCI-77 returned to CED after testing. + +Workgroup clients with no domain suffix also need an answer to the bare server +name. `scripts/Set-SguCedShortNameDns.ps1` creates the narrowly scoped AD-integrated +DNS zone `sgu-dc02`, with an apex A record for `192.168.54.211` and dynamic updates +disabled. The regular `sgu-dc02.lci.lasalle.mx` record is unchanged. No root zone, +domain membership, hosts-file entry, or WINS service is created. + +To preserve bare SI names for clients receiving the new DNS setting, +`scripts/Sync-SguSalaShortNames.ps1` similarly maintains the seven approved SI +labels. The existing five-minute Sala DNS task invokes this helper after updating +the regular domain records. The helper mirrors each FQDN A record into its +corresponding bare-name zone and refuses to overwrite records that differ from +its protected `short-names-owned.json`. It logs to `short-names-result.json`. +All eight bare-name answers were verified, and the SYSTEM task returned exit 0. +GlobalNames support remains disabled as before this change. + +LCI-77 temporarily connected to live SSID **Sala Inmersiva**, received +`192.168.55.201` with DNS `192.168.54.211`, and successfully queried the bare +`SGU-DC02`, its FQDN, SI-03's FQDN, and a public Internet name. This verifies the +new DHCP setting and DNS access across the VLANs. SI-03 itself was not remotely +reconfigured: its WinRM ports were unavailable, so its user was asked to reconnect +Wi-Fi and verify the short name. Existing clients may keep their previous DHCP +DNS settings until reconnection or lease renewal. + +Internal DNS now depends on SGU-DC02 in Sala as it already does in CED. Personal +Wi-Fi authentication still does not require RADIUS or domain membership. To roll +back this follow-up, restore Sala's DNS selection to **Default**, disable the +short-name helper invocation, and remove only the eight owned bare-name zones +after comparing their A records with `short-names-owned.json`. Keep the existing +secure domain zone and the original approved-name synchronization task. + To recover the previous Wi-Fi, first provision an existing known-good profile and reconnection task on SGU-DC02 and affected PCs. Then restore Aula Flexible on VLAN 53, or re-enable the preserved Sala de Desarrollo network, as appropriate. diff --git a/scripts/Set-SguCedShortNameDns.ps1 b/scripts/Set-SguCedShortNameDns.ps1 new file mode 100644 index 0000000..de9a33a --- /dev/null +++ b/scripts/Set-SguCedShortNameDns.ps1 @@ -0,0 +1,28 @@ +# Administrative setup for workgroup clients that have no AD DNS suffix. +# This narrowly scoped authoritative zone answers only the bare server name; +# the normal lci.lasalle.mx zone continues to handle its FQDN. +[CmdletBinding()] +param() +$ErrorActionPreference = 'Stop' +Import-Module DnsServer +if ($env:COMPUTERNAME -ne 'SGU-DC02') { throw 'Run this setup on SGU-DC02.' } +$zone = 'sgu-dc02' +$address = '192.168.54.211' +$existingZone = Get-DnsServerZone | Where-Object ZoneName -eq $zone +if (-not $existingZone) { + Add-DnsServerPrimaryZone -Name $zone -ReplicationScope Domain -DynamicUpdate None +} elseif (-not $existingZone.IsDsIntegrated -or $existingZone.DynamicUpdate -ne 'None') { + throw 'Existing short-name zone needs review.' +} +$records = @(Get-DnsServerResourceRecord -ZoneName $zone -Name '@' | + Where-Object { $_.RecordType -notin @('SOA','NS') }) +if ($records.Count -gt 0) { + if ($records.Count -ne 1 -or $records[0].RecordType -ne 'A' -or + $records[0].RecordData.IPv4Address.IPAddressToString -ne $address) { + throw 'Existing short-name record differs; refusing to overwrite it.' + } +} else { + Add-DnsServerResourceRecordA -ZoneName $zone -Name '@' -IPv4Address $address -TimeToLive ([TimeSpan]::FromMinutes(5)) +} +Resolve-DnsName "$zone." -Server 127.0.0.1 -Type A -DnsOnly | + Select-Object Name,IPAddress diff --git a/scripts/Sync-SguSalaShortNames.ps1 b/scripts/Sync-SguSalaShortNames.ps1 new file mode 100644 index 0000000..a3dbe02 --- /dev/null +++ b/scripts/Sync-SguSalaShortNames.ps1 @@ -0,0 +1,58 @@ +# Keep bare-name DNS answers available to Sala workgroup clients with no suffix. +# Each narrowly scoped zone has one A record; normal FQDN records remain the +# source of truth. No root zone, wildcard, nonsecure updates, or hosts-file edits. +[CmdletBinding()] +param([string]$ManifestPath = 'C:\ProgramData\LCI-Admin\Sala-DNS\manifest.json') +$ErrorActionPreference = 'Stop' +Import-Module DnsServer +if ($env:COMPUTERNAME -ne 'SGU-DC02') { throw 'Run this sync on SGU-DC02.' } +$folder = Split-Path $ManifestPath +$statePath = Join-Path $folder 'short-names-owned.json' +$manifest = Get-Content -LiteralPath $ManifestPath -Raw | ConvertFrom-Json +if ($manifest.Zone -ne 'lci.lasalle.mx') { throw 'Unexpected source zone.' } +$owned = @{} +if (Test-Path -LiteralPath $statePath) { + $state = Get-Content -LiteralPath $statePath -Raw | ConvertFrom-Json + foreach ($property in $state.PSObject.Properties) { $owned[$property.Name] = $property.Value } +} +$results = @() +$failed = $false +foreach ($name in (@('sgu-dc02') + @($manifest.Records.Name) | Sort-Object -Unique)) { + try { + if ($name -notmatch '^(sgu-dc02|si-\d{2})$') { throw 'Name outside approved scope.' } + $source = @(Get-DnsServerResourceRecord -ZoneName $manifest.Zone -Name $name -RRType A) + if ($source.Count -ne 1) { throw 'Expected one source A record.' } + $ip = $source[0].RecordData.IPv4Address.IPAddressToString + if ($ip -notmatch '^192\.168\.(54|55)\.\d{1,3}$') { throw 'Source IP outside managed networks.' } + $zone = Get-DnsServerZone | Where-Object ZoneName -eq $name + if (-not $zone) { + Add-DnsServerPrimaryZone -Name $name -ReplicationScope Domain -DynamicUpdate None + $owned[$name] = $ip + } elseif (-not $owned.ContainsKey($name) -or -not $zone.IsDsIntegrated -or $zone.DynamicUpdate -ne 'None') { + throw 'Existing bare-name zone is not owned by this sync.' + } + $records = @(Get-DnsServerResourceRecord -ZoneName $name -Name '@' | Where-Object RecordType -notin @('SOA','NS')) + if ($records.Count -eq 0) { + Add-DnsServerResourceRecordA -ZoneName $name -Name '@' -IPv4Address $ip -TimeToLive ([TimeSpan]::FromMinutes(5)) + } elseif ($records.Count -ne 1 -or $records[0].RecordType -ne 'A' -or + $records[0].RecordData.IPv4Address.IPAddressToString -ne $owned[$name]) { + throw 'Bare-name record differs from the owned record; refusing to overwrite it.' + } elseif ($ip -ne $owned[$name]) { + $updated = $records[0].Clone() + $updated.RecordData.IPv4Address = [Net.IPAddress]::Parse($ip) + $updated.TimeToLive = [TimeSpan]::FromMinutes(5) + Set-DnsServerResourceRecord -ZoneName $name -OldInputObject $records[0] -NewInputObject $updated + } + $owned[$name] = $ip + $results += [pscustomobject]@{Name=$name;IP=$ip;Status='Current';Error=$null} + } catch { + $failed = $true + $results += [pscustomobject]@{Name=$name;IP=$null;Status='Error';Error=$_.Exception.Message} + } +} +$owned | ConvertTo-Json | Set-Content -LiteralPath "$statePath.next" -Encoding UTF8 +Move-Item -LiteralPath "$statePath.next" -Destination $statePath -Force +[pscustomobject]@{Time=(Get-Date).ToString('o');Records=$results} | ConvertTo-Json -Depth 5 | + Set-Content -LiteralPath (Join-Path $folder 'short-names-result.json') -Encoding UTF8 +$results +if ($failed) { throw 'Some bare-name records could not be synchronized. See short-names-result.json.' } diff --git a/scripts/Sync-SguSalaWorkgroupDns.ps1 b/scripts/Sync-SguSalaWorkgroupDns.ps1 index a2e8c5f..1532f75 100644 --- a/scripts/Sync-SguSalaWorkgroupDns.ps1 +++ b/scripts/Sync-SguSalaWorkgroupDns.ps1 @@ -66,4 +66,7 @@ Move-Item -LiteralPath "$ManifestPath.next" -Destination $ManifestPath -Force [pscustomobject]@{ Time = (Get-Date).ToString('o'); Records = $results } | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path (Split-Path $ManifestPath) 'last-result.json') -Encoding UTF8 $results +# When installed, also preserve bare-name answers for workgroup clients on Sala. +$shortNameSync = Join-Path $PSScriptRoot 'Sync-SguSalaShortNames.ps1' +if (Test-Path -LiteralPath $shortNameSync) { & $shortNameSync -ManifestPath $ManifestPath } if ($failed) { throw 'One or more Sala DNS records could not be synchronized. See last-result.json.' }