Technical Information
Microsoft DNS to NetBox Object Mapping
Object Type Mapping
| Microsoft DNS Object | NetBox Object | Notes |
|---|---|---|
| A record (IPv4) | IPAddress | Address as /32 CIDR; dns_name set to FQDN; status = active |
| AAAA record (IPv6) | IPAddress | Address as /128 CIDR; dns_name set to FQDN; status = active |
| PTR record (reverse zone) | IPAddress | IP reconstructed from the reverse-zone record name (/32 or /128); dns_name set to the PTR target FQDN; status = active |
| Zone-to-tenant mapping | Tenant | One Tenant entity per distinct mapped tenant name (see Zone-to-tenant mapping); slug derived from the name |
Forward-lookup zones are processed for A and AAAA records, and reverse-lookup zones (*.in-addr.arpa, *.ip6.arpa) are processed for PTR records. Autocreated zones are excluded.
IP Address Field Mapping
| NetBox Field | Source | Notes |
|---|---|---|
address | Address field from DNS record | Formatted as CIDR - /32 for A records, /128 for AAAA records; for PTR records the address is reconstructed from the reverse-zone record name |
dns_name | HostName + ZoneName, or PTR target FQDN | For A and AAAA records, constructed as HostName.ZoneName (uses ZoneName alone when HostName is @ or empty). When a PTR record exists for the IP, the PTR target FQDN is used instead |
status | Static | Always active |
description | Static | Microsoft DNS - {host}, A record, Microsoft DNS - {host}, AAAA record, or Microsoft DNS - {host}, PTR record |
tenant | MSFT_DNS_ZONE_TENANT_MAP | Assigned when the IP's forward zone matches a zone-to-tenant mapping entry; omitted otherwise |
Multiple DNS Names
When more than one DNS record points to the same IP address, the integration:
- Collects all FQDNs for that IP across all zones, deduplicated case-insensitively (DNS names are case-insensitive per RFC 4343)
- Selects the primary
dns_name:- If the IP has a PTR record, the PTR target FQDN becomes the primary
dns_name(a PTR is the authoritative reverse mapping), and the forward names move to the additional-names field - Otherwise, the alphabetically first forward (A/AAAA) FQDN is used
- If the IP has a PTR record, the PTR target FQDN becomes the primary
- Stores all remaining FQDNs in the
msft_dns_additional_namescustom field as a JSON array
The tie-break is deterministic and independent of zone processing order, so the same input always produces the same primary dns_name.
Example: IP 10.0.1.10 with A records for portal.corp.example.com, web1.corp.example.com, and www.corp.example.com (no PTR record):
dns_name:portal.corp.example.com(alphabetically first)msft_dns_additional_names:["web1.corp.example.com", "www.corp.example.com"]
Custom Fields
The following custom field is created during bootstrap and applied to IP Address objects:
| Custom Field Name | Label | Type | Object Type | Description |
|---|---|---|---|---|
msft_dns_additional_names | Microsoft DNS Additional Names | JSON | ipam.ipaddress | Additional DNS names pointing to this IP address |
Custom fields are read-only in the NetBox UI (ui_editable: no).
Tags
All IP Address entities ingested by the Microsoft DNS integration are tagged with:
| Tag | Description |
|---|---|
microsoft | Applied to all entities from this integration |
dns | Identifies objects sourced from a DNS server |
discovered | Standard tag applied to all controller integration objects |
msft-dns-{host} | Unique per-agent tag identifying the source DNS server; e.g., msft-dns-dns-server.corp.example.com |
Zone Filtering Behavior
| Scenario | Result |
|---|---|
Neither INCLUDE_ZONES nor EXCLUDE_ZONES set | All forward-lookup zones are synced |
INCLUDE_ZONES set | Only zones matching at least one include pattern are synced |
EXCLUDE_ZONES set | Zones matching any exclude pattern are removed from the result set |
| Both set | Include filter applied first, then exclude filter |
INCLUDE_ZONES: [] (empty list) | Zero zones synced |
EXCLUDE_ZONES: [] (empty list) | No zones excluded (equivalent to omitting the key) |
| All zones filtered out after discovery | Warning logged |
Patterns use fnmatch glob syntax. Matching is case-insensitive (RFC 1035). Filtering happens before per-zone record queries, so excluded zones incur no API round-trip.
Zone filters apply to forward-lookup zones only. Reverse-lookup zones are not matched against MSFT_DNS_INCLUDE_ZONES / MSFT_DNS_EXCLUDE_ZONES. Instead, each PTR record is scoped by its target FQDN and that FQDN's parent domains, which makes reverse scoping intentionally more permissive than forward scoping for exact (non-glob) patterns. To confine reverse sync to a single label, use a glob pattern (for example *.example.com) rather than an exact zone name.
Zone-to-tenant mapping
MSFT_DNS_ZONE_TENANT_MAP assigns a NetBox tenant to the IP addresses discovered in matching zones. It is aimed at MSP and multi-client deployments where one Microsoft DNS server hosts zones for many end-clients and each client's records should land under its own tenant.
The value maps a zone name (or fnmatch glob pattern) to a tenant name:
config:
MSFT_DNS_ZONE_TENANT_MAP:
"client-a.local": "Client A"
"client-b.corp": "Client B"
"*.internal": "Internal"The environment-variable form uses zone:tenant pairs separated by commas: MSFT_DNS_ZONE_TENANT_MAP="client-a.local:Client A,*.internal:Internal". In this form, zone patterns and tenant names must not contain : or ,.
Matching behavior:
- Zone names are matched case-insensitively, using the same glob rules as
MSFT_DNS_INCLUDE_ZONES. - An exact zone-name match wins over any glob pattern; among glob patterns, the first match in declaration order wins.
- A zone that matches nothing gets no tenant.
- When an IP is referenced by records in more than one zone, the tenant is resolved from the zone of the alphabetically-first forward (A/AAAA) FQDN. Reverse (PTR) zones are never tenant-mapped, so an IP discovered only via PTR carries no tenant.
Each distinct mapped tenant is emitted as a Tenant entity (deduplicated by name, with a slugified slug). Diode creates the tenant in NetBox if it does not already exist. Tenant names must produce distinct slugs; the integration rejects a configuration whose tenant names collapse to the same slug (for example Internal and internal).
Configuration Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
MSFT_DNS_HOST | string | required | Windows DNS Server hostname or IP address |
MSFT_DNS_USERNAME | string | required | WinRM service account (typically DOMAIN\username) |
MSFT_DNS_PASSWORD | string | required | WinRM service account password |
MSFT_DNS_USE_SSL | bool | true | Use HTTPS WinRM on port 5986; set false for HTTP on port 5985 |
MSFT_DNS_PORT | int | 5986 / 5985 | Override the default WinRM port |
MSFT_DNS_VERIFY_SSL | bool | false | Verify the WinRM TLS certificate; off by default as Windows servers commonly use self-signed certificates |
MSFT_DNS_INCLUDE_ZONES | list[string] | null (all zones) | Glob patterns or exact zone names; only matching zones are synced |
MSFT_DNS_EXCLUDE_ZONES | list[string] | null (none excluded) | Glob patterns or exact zone names; applied after include filter |
MSFT_DNS_ZONE_TENANT_MAP | dict[string,string] | null (none) | Maps zone names or glob patterns to NetBox tenant names; matched zones' IP addresses are assigned the tenant. Also accepts the env-string form "zone:tenant,zone:tenant" |
BOOTSTRAP | bool | false | When true, emits only custom field definitions with no DNS server connection required |
Connection Details
The integration uses the pypsrp library to connect over WinRM/PSRP with NTLM authentication. The following PowerShell cmdlets are executed on the target server:
| Cmdlet | Purpose |
|---|---|
Get-DnsServerZone | Retrieves DNS zones; the forward query is filtered to forward-lookup, non-autocreated zones, and a separate reverse query returns reverse-lookup Primary/Secondary zones |
Get-DnsServerResourceRecord -RRType A | Retrieves A records for each forward zone |
Get-DnsServerResourceRecord -RRType AAAA | Retrieves AAAA records for each forward zone |
Get-DnsServerResourceRecord -RRType Ptr | Retrieves PTR records for each reverse zone |
Known Limitations
- Records deleted on the DNS server are not removed from NetBox. The integration does not delete NetBox objects. When an A, AAAA, or PTR record is deleted, or its zone is no longer synced, the IP address stays in NetBox with the values from the last run that included it. Handle these removals manually.