Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/qiujun8023/cfdns

A command line tool for managing Cloudflare DNS records
https://github.com/qiujun8023/cfdns

cloudflare cloudflare-cli cloudflare-dns

Last synced: 23 days ago
JSON representation

A command line tool for managing Cloudflare DNS records

Awesome Lists containing this project

README

        

# cfdns

A command line tool for managing Cloudflare DNS records

## Install

```shell
$ npm i -g cfdns-cli
```

## Usage

```
Usage: cfdns [options] [command]

Options:
-V, --version output the version number
-h, --help output usage information

Commands:
login login Cloudflare with email and key
logout logout Cloudflare
list [domain] list all DNS records
add add a DNS record
modify [new_content] modify a DNS record
remove [content] remove a DNS record
help [cmd] display help for [cmd]
```

### Login

**Syntax:**

```shell
$ cfdns login
```

**Examples:**

```shell
$ cfdns login [email protected] 8c9ec98e451df3a798029dd98abee27d
```

### Logout

**Syntax:**

```shell
$ cfdns logout
```

### List

**Syntax:**

```shell
$ cfdns list [domain]
```

**Examples:**

```shell
$ cfdns list
$ cfdns list example.com
```

### Add

**Syntax:**

```shell
$ cfdns add
```

**Arguments:**

* `--ttl` Special TTL value (default: 1)
* `--proxy` Enable Cloudflare's proxy

**Examples:**

```shell
$ cfdns add www.example.com A 8.8.8.8
$ cfdns add www.example.com A 8.8.8.8 --ttl 120
$ cfdns add www.example.com A 8.8.8.8 --ttl 120 --proxy
```

### Modify

**Syntax:**

```shell
$ cfdns modify
```

**Arguments:**

* `--ttl` Special TTL value (default: 1)
* `--proxy` Enable Cloudflare's proxy
* `--old-content` Old DNS record content

**Examples:**

```shell
$ cfdns modify www.example.com A 8.8.4.4
$ cfdns modify www.example.com A 8.8.4.4 --ttl 360
$ cfdns modify www.example.com A 8.8.4.4 --proxy
$ cfdns modify www.example.com A 8.8.4.4 --old-content 8.8.8.8
```

### Remove

**Syntax:**

```shell
$ cfdns remove [type] [content]
```

**Arguments:**

* `-f, --force` Force to delete multiple records

**Examples:**

```shell
$ cfdns remove www.example.com
$ cfdns remove www.example.com A
$ cfdns remove www.example.com A 8.8.4.4
$ cfdns remove www.example.com A 8.8.4.4 --force
```