Skip to main content

Command line tool for manipulating DNS of CloudFlare hosted domains

Project description

CLI tool for manipulating DNS of CloudFlare hosted domains. This tool uses CloudFlare’s v4 API to add, remove, list, or modify DNS records.

Installation

Install using pip.

$ pip install cfdns

Usage

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbosity

Actions:
  {add,remove,modify,list}
    add                 Add DNS Records
    remove              Remove DNS records
    modify              Modify existing records
    list                List existing records

Listing records

List DNS records or a set of DNS records by calling the list action.

Syntax:

$ cfdns list <email> <api_key> <domain>

Additional arguments:

  • --name - Match records with the specified name

  • --type - Match records with the specified type A, AAAA, CNAME, or MX

  • --content - Match records with the specified content

Examples:

$ cfdns list email@example.com 12345api
$ cfdns list email@example.com 12345api --name www.example.com
$ cfdns list email@example.com 12345api --name www.example.com --type A
$ cfdns list email@example.com 12345api --name www.example.com --type A --content 10.0.0.1
$ cfdns list email@example.com 12345api --type A
$ cfdns list email@example.com 12345api --type A --content 10.0.0.1
$ cfdns list email@example.com 12345api --content 10.0.0.1

Adding a Record

Add DNS records with the add action.

Syntax:

$ cfdns add <email> <api_key> <domain> <record_name> <record_type> <record_content>

Supported record types are: A, AAAA, CNAME, & MX

Additional Arguments:

  • --ttl - Specify the TTL value (default: 0)

  • --noproxy - Disable CloudFlare’s proxying

Examples:

$ cfdns add email@example.com 12345api example.com www.example.com A 10.0.0.1
$ cfdns add email@example.com 12345api example.com www.example.com A 10.0.0.1 --ttl 20
$ cfdns add email@example.com 12345api example.com www.example.com A 10.0.0.1 --noproxy

Removing a Record

Remove one or more DNS records with the remove action.

Syntax:

$ cfdns remove <email> <api_key> <domain> --name <record_name> --content <record_content>

The --name or --content flags can be used together or on their own to limit the number of records to be deleted. At least one flag must be used or no records will be deleted.

  • --name - Match records with a specified name

  • --content - Match records with a specified content

Examples:

$ cfdns remove email@example.com 12345api example.com --name test.example.com --content 10.0.0.1
$ cfdns remove email@example.com 12345api example.com --name test.example.com
$ cfdns remove email@example.com 12345api example.com --content 10.0.0.1

Modify a Record

Modify DNS records using the modify action.

Syntax:

$ cfdns modify <email> <api_key> <domain> <old_record_content> <new_record_type> <new_record_content>

You can add the --name flag to restrict updates to only the named record. By default all records with the matching “old content” will be updated.

Examples:

$ cfdns modify email email@example.com 12345api example.com 10.0.0.1 A 10.0.0.2
$ cfdns modify email email@example.com 12345api example.com 10.0.0.1 A 10.0.0.2 --name www.example.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfdns-0.1.1.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file cfdns-0.1.1.tar.gz.

File metadata

  • Download URL: cfdns-0.1.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cfdns-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ffba4269dab5b3495f07b26bc12ad1368011b9c8185999727c7e1e7edffd7814
MD5 458ad432b83ddfe1cb9d3657e5ecd0c9
BLAKE2b-256 0119b35771f12743eb0defb81e99b253c91c08cd6a69e1c1545850129671f5d0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page