dc01: serve the site on http://norbourg.lab too

The domain name must keep resolving to the DC for AD, so redirect at the
HTTP layer: a netsh portproxy on the DC forwards port 80 to FS01, and a
firewall rule opens it. Both URLs now serve the archived site. doctor
checks the short URL and warns (not fails) when the forward is absent.
This commit is contained in:
2026-10-26 22:43:51 -04:00
parent a9e55469b3
commit 3023525737
3 changed files with 24 additions and 1 deletions
@@ -165,6 +165,22 @@ try {
Write-LabLog 'dc01: www A record already present'
}
# The domain name resolves to the DC. Forward HTTP to FS01 so the archived
# site also answers on http://norbourg.lab, not only http://www.norbourg.lab.
try {
$null = netsh.exe interface portproxy delete v4tov4 listenport=80 listenaddress='@@LAB_DC_IP@@' 2>$null
$null = netsh.exe interface portproxy add v4tov4 listenport=80 listenaddress='@@LAB_DC_IP@@' connectport=80 connectaddress='10.10.10.20'
Set-Service iphlpsvc -StartupType Automatic -ErrorAction SilentlyContinue
Start-Service iphlpsvc -ErrorAction SilentlyContinue
if (-not (Get-NetFirewallRule -DisplayName 'Norbourg HTTP forward' -ErrorAction SilentlyContinue)) {
New-NetFirewallRule -DisplayName 'Norbourg HTTP forward' -Direction Inbound `
-Protocol TCP -LocalPort 80 -Action Allow | Out-Null
}
Write-LabLog 'dc01: http://@@DOMAIN@@ forwarded to FS01'
} catch {
Write-LabLog "dc01: HTTP forward skipped ($($_.Exception.Message))"
}
# Easter egg: discoverable with nslookup -type=TXT yourlove.norbourg.lab
try {
Add-DnsServerResourceRecord -ZoneName '@@DOMAIN@@' -Name 'yourlove' -Txt `