#!/usr/bin/env bash # # Publish a public website on the same domain your Active Directory owns # https://www.zadran.net/guides/public-website-on-an-active-directory-domain # Generated from the guide, last updated 2026-09-13. # # NO WARRANTY. This script is provided as is. You are responsible for # understanding what it does before running it, and for the consequences. # Take a backup first. See https://www.zadran.net/disclaimer # # Destructive steps are left commented out on purpose -- uncomment them # only once you have understood what they do. set -euo pipefail # ---- Set these for your environment ---- # The name used for both AD and public DNS DOMAIN='example.com' # The label to delegate SUBDOMAIN='www' # From your public DNS provider NS1='ns1.example-dns.net' # From your public DNS provider NS2='ns2.example-dns.net' nslookup ${SUBDOMAIN}.${DOMAIN} 1.1.1.1 nslookup ${SUBDOMAIN}.${DOMAIN} Resolve-DnsName ${SUBDOMAIN}.${DOMAIN} -Server 1.1.1.1 Resolve-DnsName ${SUBDOMAIN}.${DOMAIN} ipconfig /flushdns Resolve-DnsName ${SUBDOMAIN}.${DOMAIN}