mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
More migration advice
This commit is contained in:
@ -35,15 +35,14 @@ This will print out a list of "corrections" that need to be performed. It will n
|
||||
|
||||
This will actually generate `zones/example.com.zone` for you. The bind provider is more configurable, and you can read more information [here.]({{site.github.url}}/providers/bind)
|
||||
|
||||
# Converting from other providers
|
||||
# Migrate more zones
|
||||
|
||||
Once you have the system working for a test zone, try converting
|
||||
other zones. Most providers have an option to export all DNS records
|
||||
as a BIND-style zone file. The utility
|
||||
Once you have the system working for a test zone, migrate other
|
||||
zones. You can manually create the `D()` statements, or you can
|
||||
generate them automatically using the
|
||||
[convertzone](https://github.com/StackExchange/dnscontrol/blob/master/misc/convertzone/README.md)
|
||||
(in the `misc/convertzone` subdirectory) can read a zonefile and output the
|
||||
first draft of a `D()` statement for a zone.
|
||||
|
||||
Add the output to the `dnsconfig.js` and clean it up until
|
||||
`dnscontrol preview` lists no changes. At that point,
|
||||
it matches the running zone precisely and the conversion is done.
|
||||
utility that is included in the DNSControl repo (it converts
|
||||
BIND-style zone files to DNSControl's language). To make sure the
|
||||
migration is correct, use `dnscontrol preview` and make sure it
|
||||
sees no differences.
|
||||
[Migration]({{site.github.url}}/migration) doc gives more detailed advice.
|
||||
|
@ -5,15 +5,17 @@ layout: default
|
||||
|
||||
Dnscontrol is a platform for seamlessly managing your dns configuration across any number of DNS hosts, both in the cloud or in your own infrastructure. It manages all of the domains for the Stack Exchange network.
|
||||
|
||||
## [Getting Started]({{site.github.url}}/getting-started)
|
||||
## [Getting Started]({{site.github.url}}/getting-started): A walk-through of the basics.
|
||||
|
||||
## [Providers]({{site.github.url}}/provider-list)
|
||||
## [Providers]({{site.github.url}}/provider-list): Which DNS providers are supported.
|
||||
|
||||
## [Language Reference]({{site.github.url}}/js)
|
||||
## [Language Reference]({{site.github.url}}/js): Description of the DNSControl language (DSL).
|
||||
|
||||
## [Examples]({{site.github.url}}/examples)
|
||||
## [Examples]({{site.github.url}}/examples): DSL examples.
|
||||
|
||||
## [github](https://github.com/StackExchange/dnscontrol)
|
||||
## [Migrating]({{site.github.url}}/migrating): Migrating zones to DNSControl.
|
||||
|
||||
## [github](https://github.com/StackExchange/dnscontrol): Get the source!
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,18 @@
|
||||
# convertzone -- Converts a standard DNS zonefile into tsv, pretty, or DSL
|
||||
|
||||
## Building the software
|
||||
|
||||
Build the software and install in your personal bin:
|
||||
|
||||
```cmd
|
||||
$ cd misc/convertzone/
|
||||
$ go build
|
||||
$ cp convertzone ~/bin/.
|
||||
```
|
||||
|
||||
|
||||
## Usage Overview
|
||||
|
||||
convertzone converts an old-style DNS zone file into one of three formats:
|
||||
|
||||
convertzone [-mode=MODE] zonename [filename]
|
||||
@ -20,7 +33,7 @@ Example:
|
||||
convertzone stackoverflow.com zone.stackoverflow.com >new/stackoverflow.com
|
||||
|
||||
|
||||
## -mode=tsv:
|
||||
### -mode=tsv:
|
||||
|
||||
This is useful for `awk` and other systems that expect a very
|
||||
uniform set of input.
|
||||
@ -30,7 +43,7 @@ Example: Print all CNAMEs:
|
||||
convertzone -mode=tsv foo.com <zone.foo.com | awk '$4 == "CNAME" { print $1 " -> " $5 }'
|
||||
|
||||
|
||||
## -mode=pretty:
|
||||
### -mode=pretty:
|
||||
|
||||
This is useful for cleaning up a zonefile. It sorts the records,
|
||||
moving SOA and NS records to the top of the zone; all other records
|
||||
@ -44,70 +57,15 @@ Example: Clean up a zone file:
|
||||
convertzone -mode=pretty foo.com <old/zone.foo.com >new/zone.foo.com
|
||||
|
||||
|
||||
## -mode=dsl:
|
||||
### -mode=dsl:
|
||||
|
||||
This is useful for generating your draft `dnsconfig.js` configuration.
|
||||
The output can be appended to the `dnsconfig.js` file as a good first draft.
|
||||
You'll probably need to clean it up
|
||||
a bit:
|
||||
|
||||
* remove NS records. DnsProvider() inserts NS records for you.
|
||||
* re-order the records to be more logical and readable. (remember that the last item in a list must not end with a comma)
|
||||
* manually check over the results.
|
||||
Example: Generate statements for a dnsconfig.js file:
|
||||
|
||||
When converting a zonefile to DSL, we recommend a 2-phase process. First
|
||||
create a dnsconfig.js file that exactly replicates your existing configuration.
|
||||
Only when that is complete should you make any changes to the DNS zone data.
|
||||
This is not required, but it is a lot safer.
|
||||
convertzone -mode=dsl foo.com <old/zone.foo.com >first-draft.js
|
||||
|
||||
### Step 0: Build the software.
|
||||
|
||||
Build the software and install in your personal bin:
|
||||
|
||||
```cmd
|
||||
$ cd misc/convertzone/
|
||||
$ go build
|
||||
$ cp convertzone ~/bin/.
|
||||
```
|
||||
|
||||
### Step 1: Convert exactly as-is.
|
||||
|
||||
In this phase the goal is to create a dnsconfig.js that exactly
|
||||
replicates the existing DNS data.
|
||||
|
||||
Edit dnsconfig.js until `dnscontrol preview` shows no errors and
|
||||
no changes to be made. This means the conversion of your old DNS
|
||||
data is correct.
|
||||
|
||||
Resist the temptation to clean up and old, obsolete, records or to
|
||||
add anything new. Experience has shown that making changes at this
|
||||
time leads to difficult-to-find errors.
|
||||
|
||||
If convertzone could have done a better job, please let us know!
|
||||
|
||||
### Step 2: Make any changes you desire.
|
||||
|
||||
Once `dnscontrol preview` lists no changes, do any cleanups
|
||||
you want. For example, remove obsolete records or add new ones.
|
||||
|
||||
### Example workflow
|
||||
|
||||
Example: Convert a zone file and add it to your configuration:
|
||||
|
||||
# Note this command uses ">>" to append to dnsconfig.js. Do
|
||||
# not use ">" as that will erase the existing file.
|
||||
convertzone -mode=dsl foo.com <old/zone.foo.com >>dnsconfig.js
|
||||
#
|
||||
dnscontrol preview
|
||||
vim dnsconfig.js
|
||||
# (repeat until all warnings/errors are resolved)
|
||||
#
|
||||
# When everything is as you wish, push the changes live:
|
||||
dnscontrol push
|
||||
# (this should be a no-op)
|
||||
#
|
||||
# Make any changes you do desire:
|
||||
vim dnsconfig.js
|
||||
dnscontrol preview
|
||||
# (repeat until all warnings/errors are resolved)
|
||||
dnscontrol push
|
||||
Note: The conversion is not perfect. You'll need to manually clean
|
||||
it up and insert it into `dnsconfig.js`. More instructions in the
|
||||
DNSControl [migration doc]({site.github.url}}/migration).
|
||||
|
Reference in New Issue
Block a user