Headless Microsoft DNS sync for Windows Server Core without the desktop agent UI

Microsoft DNS Discovery via Windows Server Core

Use this guide when Microsoft DNS collection runs on Windows Server Core (or any headless Windows Server install) where there is no desktop shell, system tray, or in-app DNS tab.

For Windows 10/11 or Server with Desktop Experience, use Microsoft DNS Discovery via Desktop (GUI) instead.

The headless agent performs the same Microsoft DNS collection and LightMesh sync as the desktop build: DnsServer PowerShell → local SQLite cache → GraphQL sync. After the first successful sync, LightMesh shows the DNS server under Configuration > Discovery > MS DNS and zones/records under Network > DNS the same way as in the desktop guide.

Desktop vs Server Core deliverable

Deployment Download Install path
Desktop / Server with UI Download MSI on Support > Downloads MSI under the usual Program Files layout; start DNS from the agent DNS tab
Windows Server Core Download ZIP on Support > Downloads; do not use the MSI as the primary install Extract to C:\Program Files\lightmesh-discovery-agent\, set enable_dns_collection (and enable_dhcp_collection = false on DNS-only hosts), register the Windows Service via PowerShell

Server Core build behavior:

  • No dashboard, tray, or --ui (headless binary exits with an error if --ui is passed).
  • GraphQL sync only. On Server Core, do not set lightmesh.mode in config.toml — the headless build always uses GraphQL sync and ignores that key if present.
  • Toggle DNS with enable_dns_collection in config.toml, or --enable-dns-collection / --disable-dns-collection.

Prerequisites

On the Windows Server Core host where you install the agent:

  • Operating system: 64-bit Windows Server Core 2016 or later, with the DNS server role installed when collecting locally on that machine (or network reachability to a remote DNS host via [dns].computer_name).

  • DnsServer PowerShell module: Same cmdlets as the desktop MS DNS guide. Verify in an elevated PowerShell session:

    Get-DnsServerZone | Select-Object ZoneName, ZoneType, IsReverseLookupZone
  • Permissions: Local Administrator to install, uninstall, or control the Windows Service.

  • Network: Outbound HTTPS from the agent host to your LightMesh URL (hostname only, no /graphql path).

  • Disk: Write access for the SQLite database path and log files configured in config.toml.

LightMesh URL examples

Set base_url under [lightmesh] in config.toml to the same hostname you use in the browser:

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

Who can create API keys and manage MS DNS sync

Sign in to LightMesh as a user with the Owner or Administrator application role to open Admin > API Keys, Support > Downloads, and Configuration > Discovery. On the Windows Discovery Agent card, use Download ZIP for Server Core (not Download MSI). Only Owners and Administrators can change Include reverse and Sync in LightMesh.

1. Create a Discovery Agent API key

Same as the desktop guide, step 1: create a key with the Discovery Agent role and store it securely.

Create a Discovery Agent API key

2. Download the Server Core agent zip

  1. In LightMesh, go to Support > Downloads.
  2. On the Windows Discovery Agent card, under Server Core package (.zip), click Download ZIP.

Windows Discovery Agent - Download ZIP

Optional direct download:

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

Extract the zip on the Server Core host so lightmesh-discovery-agent.exe and config.toml sit in the same folder (for example under C:\Program Files\lightmesh-discovery-agent\, matching the DHCP and ping-sweep Server Core guides).

3. Edit config.toml

Open config.toml in an elevated editor and set at least:

[collector]
host_name = "dns01"

[source]
server_fqdn = "dns01.contoso.local"

[lightmesh]
base_url = "https://next.lightmesh.com"   # your LightMesh hostname
api_token = "YOUR_DISCOVERY_AGENT_API_KEY"

# DNS-only host: turn DHCP collection off or Get-DhcpServerv4Scope fails and the
# cycle never reaches MS DNS sync (and can create an empty DHCP server in LightMesh).
enable_dhcp_collection = false   # leave true if this server also runs DHCP
enable_dns_collection = true
# dns_server_id =          # filled automatically after first GraphQL createDNSServer

# Optional: collect from a remote Microsoft DNS host instead of localhost.
# [dns]
# computer_name = "dns02.contoso.local"
Section Key Notes
[collector] host_name Name shown for this agent / DNS server identity in LightMesh.
[source] server_fqdn FQDN used when naming the DNS server; avoid ZIP placeholders like discoveryagent01.
[lightmesh] enable_dhcp_collection Set false on a DNS-only host. Leave true if this server also runs DHCP.
[lightmesh] enable_dns_collection Set true when you are ready to sync Microsoft DNS.

Leave enable_dns_collection = false until you are ready. Ping sweep stays independent.

Warning: Prefer installing the agent on the DNS server. For remote collection ([dns].computer_name), the service defaults to Local System, so queries use the agent server’s computer account (or a gMSA). Grant only the DnsServer read rights needed — do not use a Domain Admin account.

4. Install and start the Windows Service

From an elevated PowerShell session in the agent directory:

cd "C:\Program Files\lightmesh-discovery-agent"
.\lightmesh-discovery-agent.exe --service-install
.\lightmesh-discovery-agent.exe --service-start

If the service is already installed, enable DNS collection via CLI (writes config) then start — or leave a running service alone; it rereads config.toml every cycle, so --enable-dns-collection is picked up on the next cycle without a restart:

.\lightmesh-discovery-agent.exe --enable-dns-collection
.\lightmesh-discovery-agent.exe --service-start

One-shot foreground collect (optional, for validation):

.\lightmesh-discovery-agent.exe --collect-once

Server Core service install and start

5. Confirm in LightMesh

  1. Open Configuration > Discovery > MS DNS. After the first sync, the Windows DNS server appears with Last Synced, Include reverse, and Sync.
  2. Turn on Include reverse only if you need reverse zones / PTR records.
  3. Open Network > DNS and confirm zones/records with Source: Microsoft DNS.

Discovery MS DNS after Server Core sync

For the empty How to connect card, Source filter, and IP drawer disclaimer, see the desktop guide.

Operational notes

  • Include reverse is owned by LightMesh (Owner/Administrator). The agent only syncs reverse zones when that toggle is on.
  • Identity for DNS is dns_server_id, not dhcp_server_id. The agent stores it after the first successful createDNSServer.
  • Use --disable-dns-collection to stop DNS collection without affecting DHCP or ping sweep.

Troubleshooting

  1. Confirm enable_dns_collection = true in config.toml and that the Windows Service is running.
  2. On a DNS-only host, confirm enable_dhcp_collection = false. Otherwise DHCP collection errors can block the cycle before MS DNS sync.
  3. Run .\lightmesh-discovery-agent.exe --probe-endpoint (or your environment’s connectivity probe) and fix Base URL / API token until it succeeds.
  4. Check agent.log for DnsServer PowerShell or GraphQL errors.
  5. Verify Get-DnsServerZone works under the service account (and against [dns].computer_name if set).
  6. Confirm the API key role is Discovery Agent and has not expired.
  7. Confirm host_name / server_fqdn are real names for this host, not ZIP template placeholders.

Once the first cycle completes, LightMesh MS DNS and Network → DNS behave the same as with the desktop agent.