# zone-replicator

> Duplicate your A, CNAME, TXT and MX records to Digital Ocean and Route 53

Latest version **2.0.4** (published 2023-02-10) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install zone-replicator
pnpm add zone-replicator
yarn add zone-replicator
bun add zone-replicator
```

Provides the commands `cfd`, `cfdd`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2023-02-10 |
| First published | 2022-03-27 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.0.0 |
| Dependencies | 4 |
| Unpacked size | 98.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | edeckers |
| Keywords | backup, clone, cloudflare, copy, digitalocean, dns, duplicate, replicate, ns2, typescript |

## Links

- npm: https://www.npmjs.com/package/zone-replicator
- npm.io page: https://npm.io/package/zone-replicator

## Dependencies (4)

- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.1101.0
- [cloudflare](https://npm.io/package/cloudflare.md) ^2.9.1
- [dns-zonefile](https://npm.io/package/dns-zonefile.md) 0.2.10
- [dots-wrapper](https://npm.io/package/dots-wrapper.md) ^3.7.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.4 (latest) — 2023-02-10
- 2.0.3 — 2022-03-28
- 2.0.2 — 2022-03-27
- 2.0.1 — 2022-03-27
- 2.0.0 — 2022-03-27

## README

# Zone replicator

[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
[![Tests](https://github.com/edeckers/zone-replicator/actions/workflows/test.yml/badge.svg?branch=develop)](https://github.com/edeckers/zone-replicator/actions)

Copies all `A`, `CNAME`, `TXT` and `MX` records from a zone file to Digital Ocean and Route 53, so they serve as a backup nameservers. 

⚠️ These scripts _nuke all records of the mentioned types in the targeted zone without warning!_

# Requirements

- NodeJS 14.x+

# Installation

```bash
yarn global add zone-replicator
```

# Configuration

- Copy `config.example.json` to `config.json` and apply necessary changes

# Usage

There are two parts to this script, the sender and the receiver. The sender sends a raw DNS Zone file to _stdout_, the receiver listens for input op _stdin_, so these scripts can be used in tamdem through a pipe.

The convenience script `duplicate.sh` demonstrated below, combines these two commands.

>⚠️ The presented commands _nuke all records of types A, CNAME, TXT and MX on the target zone on your Digital Ocean account without warning!_

```bash
CLOUD_SYNC_CONFIG=/path/to/config.json bin/duplicate.sh <yourdomain.com>
```
Or after installing the npm package:
```bash
# duplicate
CLOUD_SYNC_CONFIG=/path/to/config.json cfdd <yourdomain.com>

# which expands to
CLOUD_SYNC_CONFIG=/path/to/config.json cfd zone:read <yourdomain.com> | cfd zone:write
```


Or in a Docker container, after copying `docker-compose.example.yml` to `docker-compose.yml` and applying the necessary changes.

```bash
docker-compose run replicator duplicate <yourdomain.com>
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the  repository and the development workflow.

## Code of Conduct

[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

## License

MPL-2.0

---
_Source: https://npm.io/package/zone-replicator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
