Sync Microsoft DNS zones and records into LightMesh using the Windows Discovery Agent

Microsoft DNS Discovery via Desktop (GUI)

Microsoft DNS discovery is a feature of the LightMesh Windows Discovery Agent. The agent collects zones and supported records (A, AAAA, CNAME, PTR) through the Microsoft DnsServer PowerShell module, caches them locally, and syncs them to LightMesh over GraphQL. After the first successful sync, LightMesh shows the DNS server under Configuration > Discovery > MS DNS, and the zones and records under Network > DNS. When an A/AAAA record uniquely matches an IP assignment, the subnet IP drawer and list also show a Source: Microsoft DNS disclaimer and keep those agent rows read-only.

DNS collection is independent of DHCP and ping sweep. Existing agents keep DHCP / ping sweep unchanged when Microsoft DNS collection is off (the default).

Windows Server Core: Use the dedicated Microsoft DNS Discovery on Windows Server Core guide. Server Core uses the headless zip (not the desktop MSI) and PowerShell / config.toml instead of the in-app DNS tab.

Prerequisites

On the Windows machine where you install the agent:

  • Operating system: 64-bit Windows (x86_64). Windows Server 2016 or later is recommended for production DNS collection.

  • DnsServer PowerShell module: The Microsoft DNS cmdlets the agent calls must be available on that host (or on the remote host you target with [dns].computer_name):

    • Get-DnsServerZone
    • Get-DnsServerResourceRecord (per zone)
  • Permissions: Local administrator rights to install, uninstall, or control the Windows service (expect a UAC prompt). The service itself can run under a configured service account after installation.

  • Network: Outbound HTTPS from the agent host to your LightMesh URL (see examples below). The host must resolve and reach that LightMesh hostname, and must be able to query the Microsoft DNS server (local or remote).

  • Disk: Write access for the SQLite database file and agent log files (default paths are under the agent install directory).

LightMesh URL examples

Set Base URL in the agent to the same hostname you use in the browser, without a trailing path such as /graphql. Examples:

  • SaaS: https://next.lightmesh.com
  • Self-hosted: https://your-company.example.com (replace with your LightMesh hostname)

Who can create API keys, download the agent, and manage MS DNS sync

Sign in to LightMesh as a user with the Owner or Administrator application role. Those roles can open Admin > API Keys, Support > Downloads, and Configuration > Discovery. Only Owners and Administrators can change Include reverse and Sync on the MS DNS server list. Discovery Agent API keys sync data; they do not flip reverse-zone opt-in.

1. Create a Discovery Agent API key

  1. In the sidebar, go to Admin > API Keys and add a new API key.
  2. In the Add API key panel, enter a Name (for example Windows Discovery Agent — MS DNS) and, optionally, a Custom Expiration (in days). Keys expire after 30 days by default.
  3. Set Role to Discovery Agent (DHCP, ping sweep & agent sync only) so the key can register the agent and sync Microsoft DNS (and DHCP / ping sweep if you use those) without full tenant API access.
  4. Click Generate API Key, copy the key, then click Create API key.

Store the key securely; you will not be able to view it again after you submit the form. You will paste it into the agent as the API token.

Create a Discovery Agent API key

2. Download the Windows Discovery Agent

  1. In the sidebar, go to Support > Downloads.
  2. On the Windows Discovery Agent card, expand System requirements if you need OS, installation, permissions, network, or disk details.
  3. Under Windows installer (.msi), click Download MSI.

Use the MSI for full Windows Server (with Desktop Experience), Windows 10, or Windows 11. Do not use the MSI as the primary install on Windows Server Core; use the Server Core package (.zip) in the Server Core MS DNS guide instead.

Windows Discovery Agent - Download MSI

The same card offers the Server Core package (.zip) next to the MSI for headless deployments. Both packages support DHCP, Ping Sweep, and MS DNS.

Optional direct download (same MSI as Download MSI):

https://get.lightmesh.com/lightmesh-discovery-agent-win-64-latest

Run the MSI on a Windows host that can reach your Microsoft DNS server (often the DNS server itself).

3. Open the LightMesh Discovery Agent

Run the discovery agent on Windows as Administrator:

  1. Right-click lightmesh-discovery-agent.exe.
  2. Click Run as administrator.

Administrator rights are required to install and register the Windows service. Without them, Register Service on the Dashboard may fail or prompt for elevation.

The app opens Dashboard, Configuration, Logs, and Help & Setup.

If the window fails to open, look for startup_error.log next to the executable.

4. Configure LightMesh connectivity

Open Configuration. Expand LightMesh API and set:

  • Base URL: Your LightMesh URL (see examples above).
  • API Token: The Discovery Agent API key from step 1.

Use the Base URL connectivity probe (OK with a green checkmark) before you register the service. Click Save changes so values are written to config.toml.

Agent Configuration for MS DNS

5. Register the Windows service and start Microsoft DNS

On the Dashboard:

  1. Click Register Service in the top-right corner if the service is not registered yet (one-time setup; prompts for UAC).
  2. Open the DNS tab.
  3. If this Windows host does not run Microsoft DHCP, open the DHCP tab and click Stop DHCP (or clear Collect DHCP data under Configuration and save). On a DNS-only server the default DHCP collection fails first and the cycle never reaches Microsoft DNS sync.
  4. If the DNS banner says Microsoft DNS collection is off, click Start DNS (or enable Collect Microsoft DNS data under DNS settings and save).

Until DNS collection is on, the DNS tab stays idle and does not create or update a DNS server in LightMesh. Ping sweep is unchanged.

After the first GraphQL cycle with DNS collection enabled, the agent creates a DNS server in LightMesh and stores the DNS Server ID automatically. The DNS tab shows Last Sync, Zones, and Entries for the latest collection.

Agent DNS tab with collection running

Optional: if the agent is not on the DNS server itself, set a remote collector host in configuration ([dns].computer_name / the DNS computer name field) so PowerShell uses -ComputerName. Leave it empty for local DnsServer.

Warning: Prefer installing the agent on the DNS server. For remote collection, the Windows service defaults to Local System, so -ComputerName queries use the agent server’s computer account (or a dedicated gMSA). Grant only the least privilege needed to run Get-DnsServerZone / Get-DnsServerResourceRecord on the remote DNS host — do not use a Domain Admin account.

6. Review MS DNS in LightMesh

Empty state (before the first sync)

Go to Configuration > Discovery and open the MS DNS tab. Before any agent has synced, LightMesh shows a How to connect empty card (API key, download agent, enable Microsoft DNS, wait for first sync)—the same pattern as the DHCP servers empty state.

Discovery MS DNS - empty How to connect

After the first sync

When the agent finishes its first DNS sync, the MS DNS table lists each Microsoft DNS server with Server, Hostname / Address, Agent, Last Synced, Include reverse, and Sync.

  • Server — Windows host name reported for the DNS server (for example DNS01).
  • Hostname / Address — the agent’s configured host name plus the collector address. The agent does not send an IP for the DNS server identity, so the address often shows as 0.0.0.0.
  • Include reverse — off by default. Turn it on (Owner/Administrator) when you want reverse zones and PTR records synced. Forward zones sync regardless.
  • Sync — pause or resume updates for that DNS server without deleting last-known data.

Discovery MS DNS - server list after sync

Network → DNS

Open Network > DNS. Agent-synced rows show Source: Microsoft DNS. Use the Source filter (Manual vs Microsoft DNS) when you want only agent or only manual entries. Microsoft DNS record fields are read-only on the DNS entry drawer (custom attributes stay editable).

Network DNS list with Microsoft DNS Source

Subnets → IP Addresses

When an A/AAAA record uniquely matches an IP assignment, the subnet IP Addresses DNS cell shows Source: Microsoft DNS, and the IP drawer shows the agent rows as read-only with a Source disclaimer. You can still add manual DNS rows on the same IP.

Subnet IP list DNS cell with MS DNS Source

IP drawer with Microsoft DNS Source disclaimer

Operational notes

  • Include reverse is controlled in LightMesh, not by the agent. The agent only syncs reverse zones when the DNS server in LightMesh has ‘Include reverse’ on.
  • Collection interval follows the agent’s local collector poll interval. The LightMesh DNS server Polling Interval is informational today.
  • Supported record types for sync are A, AAAA, CNAME, and PTR. Other types are not imported.
  • Discovery is read-only toward Microsoft DNS: LightMesh does not push DNS changes back to the Windows DNS server. Change records on the DNS server and sync again.
  • Pausing Sync in LightMesh stops updates for that server; turning off collection on the agent stops creating or updating DNS data from that host.

Troubleshooting

If Microsoft DNS data does not appear in LightMesh:

  1. Confirm the agent service is running and the DNS tab shows collection on, with recent Last Sync and non-zero zone/entry counts when the server has data.

  2. On a DNS-only Windows host, confirm DHCP collection is off (Stop DHCP / enable_dhcp_collection = false). Otherwise Get-DhcpServerv4Scope fails and the cycle never reaches MS DNS.

  3. Open Configuration and check the Base URL connectivity probe. Fix Base URL or API Token until the probe shows OK, then Save changes and restart the service if needed.

  4. Open Logs and look for DnsServer PowerShell, authentication, or network errors.

  5. Confirm the API key uses the Discovery Agent role and has not expired.

  6. On the collector host (or remote DNS host), verify cmdlets succeed, for example:

    Get-DnsServerZone | Select-Object ZoneName, ZoneType, IsReverseLookupZone
  7. If you use a remote DNS host, confirm [dns].computer_name (or the UI computer name) is reachable with the credentials the service runs under (computer account / least privilege — not Domain Admin).

  8. Confirm Base URL uses a hostname reachable from the Windows server (avoid localhost unless LightMesh runs on the same machine).

Once collection and sync succeed, each cycle refreshes zones and records in LightMesh, and uniquely matched A/AAAA records continue to surface on subnet IP views with Source: Microsoft DNS.