Giter Site home page Giter Site logo

node-pdns's Introduction

node-pdns

CLI for PowerDNS

Intallation

sudo npm install -g pdns

Configure for MySQL

Create database "powerdns" in MySQL

sudo pdns config set db powerdns
sudo pdns config set user <mysqluser>
sudo pdns config set password <mysqlpass>

To connect on a remote MySQL server you can also set the host (default is "localhost:3306"):

sudo pdns config set host <host>

Usage

$ pdns -h

help:    domains [list|add|remove]
help:    domains list [<name> [<type> [<ttl> [<created_at>]]]] : List all domains matching the parameters
help:    domains add <domain.tld> [<type> [<ttl>]] [--soa [<soa_content>]] [--mx [<mx_content>]] [--ns [<ns_content>]] : Add a new domain
help:    	 --soa : Generate a default SOA record
help:    	 --soa=<soa_content> : Generate a SOA record using <soa_content>
help:    	 --mx : Generate a default MX record
help:    	 --mx=<mx_content> : Generate an MX record using <mx_content>
help:    	 --ns : Generate a default NS record
help:    	 --ns=<ns_content> : Generate an NS record using <ns_content>
help:    domains remove <name> [<type> [<ttl> [<created_at> [updated_at]]]] : Remove all domains matching the parameters
help:    
help:    records [list|add|remove] [--domain|-d]
help:    records list [<name> [<type> [<content>]]] -d=<domain.tld> : List all records for domain_name matching the parameters
help:    records add <name> <type> <content> [<ttl>] -d=<domain.tld> : Add a new record for <domain.tld>
help:    records remove <name> [<type> [<content> [<ttl>]]] -d=<domain.tld> : Remove all records for <domain.tld> matching the parameters
help:    
help:    Options:
help:      --domain, -d  Domain to use for the records command                                   [string]
help:      --ns          NameServer address when adding a new domain, default is "ns1.<domain.tld>"                                                       
help:      --soa         Start of autority when adding a new domain, default is "ns1.<domain.tld> admin@<domain.tld> <YYYYMMDD>01 10800 7200 604800 10800"
help:      --mx          SMTP server when adding a new domain, default is "mail.<domain.tld>"

Use adapter directly

var config = {
  adapter: "mysql",
  db: "powerdns_development",
  user: "root",
  password: "mysqlpass"
};
var pdns = require('pdns')(config);

pdns.domains.list({}, {}, function(err, domains) {...});
pdns.domains.add({name: "test.com"}, {soa:true, mx:true, ns:true}, function(err, res) {...});
pdns.domains.remove({name: "test.com"}, {}, function(err, res) {...});

pdns.records.list("test.com", {}, {}, function(err, records) {...});
pdns.records.add("test.com", {name: "ns2", type: "A", content:"10.1.0.1"}, {}, function(err, res) {...});
pdns.records.remove("test.com", {name: "ns2"}, {}, function(err, res) {...});

License

MIT license.

node-pdns's People

Contributors

darac avatar kiwoongkwon avatar tug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-pdns's Issues

Can't connect to remote server

node-pdns connects just to mysql?
I can connect to remote DB using mysql client, but not using node-pdns using the same credentials. (Setup was done per your instructions)
โžœ ~ pdns domains list
connect ECONNREFUSED

Is there a way to get more debugging info?

PostgreSQL Adapter

Hi,

my PDNS is running on a PostgreSQL db.
Any chance to get an Adapter for it?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.