---
title: "Converting Zone Files Between Text and Raw Formats"
slug: "aa-00608"
description: "Zone file storage for secondary zones expects the raw zone format by default. There are two different ways to change the format."
tags: ["zone files", "raw"]
updated: 2021-05-25T19:07:36Z
published: 2021-05-25T19:07:36Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://kb.isc.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Converting Zone Files Between Text and Raw Formats

With the development of the BIND 9.9 branch, zone file storage for secondary zones has been changed to expect the raw zone format by default. BIND administrators testing 9.9 or preparing for migration from an earlier version have asked how to deal with this format change. Several options are available.

**Rename and Retransfer:** A BIND 9.9 secondary server which encounters a zone file it cannot read (for example, because the contents are stored in a format other than what the server expects) will rename the unreadable zone file and attempt to retransfer the zone from the primary.

**Manual Conversion:** The `named-compilezone` utility, which is part of the BIND distribution, can be used to convert zones from text to raw and from raw to text.

```
# convert raw zone file "example.net.raw", containing data for zone example.net, to text-format zone file "example.net.text"
named-compilezone -f raw -F text -o example.net.text example.net example.net.raw
```

```
# convert text format zone file "example.net.text", containing data for zone example.net, to raw zone file "example.net.raw"
named-compilezone -f text -F raw -o example.net.raw example.net example.net.text
```
