{
    "@context": "https://schema.org",
    "@type": "DefinedTerm",
    "@id": "https://hostdir.net/glossary/zone-file",
    "name": "Zone File",
    "description": "A zone file is a plain-text file that contains all DNS resource records for a single domain zone, following the master file format defined in RFC 1035.",
    "url": "https://hostdir.net/glossary/zone-file",
    "inDefinedTermSet": "https://hostdir.net/glossary",
    "termCode": "zone-file",
    "mainEntityOfPage": "https://hostdir.net/glossary/zone-file",
    "license": "https://creativecommons.org/licenses/by/4.0/",
    "_hostdir": {
        "kind": "glossary-term",
        "slug": "zone-file",
        "canonical": "https://hostdir.net/glossary/zone-file",
        "term": "Zone File",
        "category": "DNS",
        "category_slug": "dns",
        "summary": "A zone file is a plain-text file that contains all DNS resource records for a single domain zone, following the master file format defined in RFC 1035.",
        "definition": "A zone file is a text file stored on an authoritative DNS server. It lists every DNS resource record for a particular zone. A zone is a distinct part of the domain namespace, such as example.com. The file follows the master file format specified in RFC 1035. This format uses a series of directives and resource record definitions. Each record maps a domain name to a type of data, such as an IP address for an A record or a mail server for an MX record.\n\nThe file typically starts with optional directives for default time-to-live (TTL) and the Start of Authority (SOA) record. The SOA record holds administrative metadata. After the SOA, other records follow, including NS records for name servers, A and AAAA records for addresses, CNAME records for aliases, and TXT records for arbitrary text. Each record line contains fields for name, TTL, class (almost always IN for Internet), record type, and record-specific data. Semicolons denote comments. The $ORIGIN directive sets a base domain name, allowing shorthand relative names.\n\nZone files are loaded by a DNS nameserver, either BIND, Knot, PowerDNS, or another implementation. Operators edit the file manually or through a management tool, then signal the server to reload the zone. A secondary server may transfer the zone file from a primary server using a zone transfer (AXFR/IXFR). The zone file format is universal across most DNS software, though some servers use alternative database backends behind the scenes.",
        "examples": "Consider the zone file for example.com. It opens with $TTL 3600, then the SOA record for ns1.example.com. admin.example.com. with serial number 2025031901. Following that are two NS records pointing to ns1 and ns2, an A record mapping the bare domain to 192.0.2.1, and a CNAME record pointing www to the bare domain. The file ends with a blank line. When a client queries the A record for example.com, the nameserver replies with the IP address from this zone file.",
        "key_facts": [
            "Defined in RFC 1035 Section 5 as the master file format.",
            "Each zone file corresponds to exactly one DNS zone.",
            "Starts with an SOA record containing zone metadata and TTL defaults.",
            "Uses semicolons for comments and parentheses for multiline records.",
            "Loaded by an authoritative nameserver and served to recursive resolvers."
        ],
        "related_terms": [
            "DNS zone",
            "Resource record",
            "SOA record",
            "Authoritative nameserver",
            "Zone transfer"
        ],
        "references": [
            {
                "title": "RFC 1035 - Domain Names - Implementation and Specification",
                "url": "https://tools.ietf.org/html/rfc1035"
            },
            {
                "title": "BIND 9 Administrator Reference Manual - Zone Files",
                "url": "https://bind9.readthedocs.io/en/latest/reference.html#zone-file-format"
            }
        ],
        "word_count": 247,
        "license": "CC BY 4.0",
        "license_url": "https://creativecommons.org/licenses/by/4.0/",
        "attribution": "HostDir Glossary — https://hostdir.net/glossary/zone-file"
    }
}