Skip to contentGo to the directory tree
  1. C:
  2. Windows
  3. System32
  4. dns
  5. <zone>.dns
FileRisk: Caution
  • Windows Server

<zone>.dns C:\Windows\System32\dns\<zone>.dns

<zone>.dns: the file of a file-backed DNS zone (not Active Directory-integrated), in BIND-compatible text format; one file per zone.

Updated on By AltF4 Formation

What it’s for

<zone> is a pattern: the file carries the zone name, for example contoso.com.dns or 10.0.10.in-addr.arpa.dns. The DNS server reads and writes the records of a file-backed primary or secondary zone there. An Active Directory-integrated zone has no file: its records live in the DomainDnsZones or ForestDnsZones application partition.

It is also the file created by a zone export, and the classic way to move a zone to another Windows server.

What it contains

Records in master-file text format (RFC 1035), BIND-compatible: an SOA record, the NS records, then A, AAAA, CNAME, MX, SRV and PTR. For dynamic records, an [Aging:number] mention gives the refresh timestamp used by scavenging.

@ IN SOA dc01.contoso.com. hostmaster.contoso.com. ( 12 900 600 86400 3600 )
@ IN NS dc01.contoso.com.
dc01 A 10.0.0.10
srv1 [Aging:3722640] A 10.0.0.21

Risks and best practices

  • On a zone that accepts dynamic updates, the service rewrites the file: a manual edit is overwritten or causes errors. Use the DNS console or PowerShell.
  • To move a zone, export it (Export-DnsServerZone), copy the file into the new server’s dns folder, then create the zone with -LoadExisting.
  • On secondary zones the file is a copy transferred from the master, not a source to edit.

Useful commands

Fenêtre de terminal
# Zones and their file (empty ZoneFile = AD-integrated zone)
Get-DnsServerZone | Select-Object ZoneName, ZoneType, IsDsIntegrated, ZoneFile
# As administrator: export a zone to system32\dns
Export-DnsServerZone -Name 'contoso.com' -FileName 'contoso.com.export.dns'
# On the new server: create the zone from the copied file
Add-DnsServerPrimaryZone -Name 'contoso.com' -ZoneFile 'contoso.com.dns' -LoadExisting
# Records of a zone
Get-DnsServerResourceRecord -ZoneName 'contoso.com' | Select-Object HostName, RecordType, Timestamp

Report a mistake