Code Monkey home page Code Monkey logo

godaddy-dns's Introduction

godaddy-dns

A Node.js script to programmatically update GoDaddy DNS records

npm version CircleCI JavaScript Style Guide


Introduction

This Node.js script allows you to programmatically update one or more GoDaddy DNS records inserting the public IP of the machine where the script is run.

Quick example:

godaddy-dns -c config.json

Requirements

This script requires Node.js (version >= 6.0.0) and a valid GoDaddy API key and secret. You can get register a new key on your GoDaddy developer page

Installation

To install the script globally you can use NPM:

npm install --global godaddy-dns

If you have the script already installed in your system, this command will update it to the latest available version.

After executing this command the script godaddy-dns will be globally available in your system. Give it a try with:

godaddy-dns -V

Binaries

From version 1.1.0, you can also install godaddy-dns by simply downloading the binary executable file for your operative system in the Releases section.

Configuration

The command needs a configuration file in order to be executed. The configuration file can be specified at runtime using the option --config, if not specfied the command will try to access the file .godaddy-dns.json in the home directory of the current user.

The configuration file contains a JSON object with the following fields:

  • apiKey: The API key for your GoDaddy account
  • secret: The API key secret for your GoDaddy account
  • domain: The domain for which to update the DNS records
  • records: An array of objects that defines the records to update. Every record object can define the following values:
  • name: (mandatory) the name of the record (e.g. "mysubdomain", "@" or "*")
  • type: (default "A") the type of entry for the record
  • ttl: (default 600) the TTL of the record in seconds (min value is 600)

You can define the DNS records in the records configuration also using a shorter syntax by just passing the name of the domain as a plain string (e.g. "mysubdomain"). If you have a single record wrapping it into an array is optional, you can simply pass it as a single string or object.

See config.json.sample for an example of how to structure your config.json.

Update multiple domains

If you need to update multiple domains you can use the option domain in the records array as in the following configuration example:

{
  "apiKey": "",
  "secret": "",
  "domain": "example.com",
  "records": [
    {"type": "A", "name": "mysubdomain", "ttl": 600},
    {"domain":"my-other-domain.com", "type": "A", "name": "subdomain2", "ttl": 600} //overrides main domain name (example.com)
  ]
}

In this example, everytime a new IP is detected the following domains will be updated:

  • mysubdomain.example.com
  • subdomain2.my-other-domain.com

Last IP cache

To avoid to send useless requests to the GoDaddy API (e.g. when the IP is not changed) the script stores the last public ip sent to GoDaddy in a cache file. This file is by default stored in the default OS temp folder with the name .lastip. You can use a custom location for this file with the option --ipFile. If you want to clear this cache (and force a new request to the GoDaddy API) you can simply delete this file.

Running the script continuously with Cron

One of the principal use cases why you might want to use this script (and actually my original motivation to create it) is to map a DNS record to a machine with a non-static IP. This way you can recreate your home-made DynamicDNS solution.

In this scenario you might want to add an entry to your Cron configuration as in the following example:

*/5 * * * * godaddy-dns > /var/log/godaddy-dns.log 2>&1

In this case the script will be executed every 5 minutes and the logs will be stored in /var/logs/godaddy-dns.log. Also note that in this example you will use the default configuration file location. If you want to specify a different location use the option --config.

Command line options

Usage: godaddy-dns [options]

  Options:

    -h, --help           output usage information
    -V, --version        output the version number
    -c, --config [file]  specify the configuration file to use  (default "<user home folder>/.godaddy-dns.json")
    -i, --ipfile [file]  specify which file to use to store the last found ip (default "<user temp folder>/.lastip")

Programmatic usage

If you want to use the features of this module in a Node.js project:

const dns = require("godaddy-dns");

dns.getCurrentIp().then((currentIp)=>{
  console.log("Current ip",currentIp);

  dns.updateRecords(currentIp,{
    "apiKey": "",
    "secret": "",
    "domain": "example.com",
    "records": [
      {"type": "A", "name": "@", "ttl": 600}
    ]
  })
  .then(() => {
    console.log(`[${new Date()}] Successfully updated DNS records to ip ${currentIp}`)
  })
  .catch((err) => {
    if (err && err.message !== 'Nothing to update') {
      console.error(`[${new Date()}] ${err}`)
      process.exit(1)
    }
  });
});

Thanks @aandrulis for suggesting to expose this.

Bugs and improvements

If you find a bug or have an idea about how to improve this script you can open an issue or submit a pull request, it will definitely make you a better person! ๐Ÿ˜

License

Licensed under MIT License. ยฉ Luciano Mammino.

godaddy-dns's People

Contributors

anotherzero avatar lmammino avatar luketlancaster avatar redsparr0w avatar russellhoff avatar tkambler 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  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  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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godaddy-dns's Issues

Forbidden when executing since 2/3/2021

I'm facing issues while updating the IP. Here it's the error log.

[Tue Mar 02 2021 14:40:03 GMT+0100 (GMT+01:00)] Current ip and last ip match. No update neccessary. [Tue Mar 02 2021 14:45:02 GMT+0100 (GMT+01:00)] Current ip and last ip match. No update neccessary. [Tue Mar 02 2021 14:50:03 GMT+0100 (GMT+01:00)] Current ip and last ip match. No update neccessary. [Tue Mar 02 2021 14:55:28 GMT+0100 (GMT+01:00)] Current ip and last ip match. No update neccessary. [Tue Mar 02 2021 15:00:06 GMT+0100 (GMT+01:00)] Current ip and last ip match. No update neccessary. [Tue Mar 02 2021 15:05:02 GMT+0100 (GMT+01:00)] StatusCodeError: 503 - "<!DOCTYPE html>\n\t<html>\n\t <head>\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t\t<meta charset=\"utf-8\">\n\t\t<title>Application Error</title>\n\t\t<style media=\"screen\">\n\t\t html,body,iframe {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t }\n\t\t html,body {\n\t\t\theight: 100%;\n\t\t\toverflow: hidden;\n\t\t }\n\t\t iframe {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tborder: 0;\n\t\t }\n\t\t</style>\n\t </head>\n\t <body>\n\t\t<iframe src=\"//www.herokucdn.com/error-pages/application-error.html\"></iframe>\n\t </body>\n\t</html>" [Tue Mar 02 2021 15:10:02 GMT+0100 (GMT+01:00)] Current ip and last ip match. No update neccessary. [Tue Mar 02 2021 15:15:03 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 15:20:25 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 15:25:23 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 15:30:08 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 15:35:03 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 15:40:02 GMT+0100 (GMT+01:00)] StatusCodeError: 503 - "<!DOCTYPE html>\n\t<html>\n\t <head>\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t\t<meta charset=\"utf-8\">\n\t\t<title>Application Error</title>\n\t\t<style media=\"screen\">\n\t\t html,body,iframe {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t }\n\t\t html,body {\n\t\t\theight: 100%;\n\t\t\toverflow: hidden;\n\t\t }\n\t\t iframe {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tborder: 0;\n\t\t }\n\t\t</style>\n\t </head>\n\t <body>\n\t\t<iframe src=\"//www.herokucdn.com/error-pages/application-error.html\"></iframe>\n\t </body>\n\t</html>" [Tue Mar 02 2021 15:45:02 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 15:50:03 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 15:55:22 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:00:12 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:05:02 GMT+0100 (GMT+01:00)] StatusCodeError: 503 - "<!DOCTYPE html>\n\t<html>\n\t <head>\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t\t<meta charset=\"utf-8\">\n\t\t<title>Application Error</title>\n\t\t<style media=\"screen\">\n\t\t html,body,iframe {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t }\n\t\t html,body {\n\t\t\theight: 100%;\n\t\t\toverflow: hidden;\n\t\t }\n\t\t iframe {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tborder: 0;\n\t\t }\n\t\t</style>\n\t </head>\n\t <body>\n\t\t<iframe src=\"//www.herokucdn.com/error-pages/application-error.html\"></iframe>\n\t </body>\n\t</html>" [Tue Mar 02 2021 16:10:03 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:15:02 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:20:16 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:25:03 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:30:05 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:35:04 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:40:02 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:45:03 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:50:03 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 16:55:04 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 17:00:09 GMT+0100 (GMT+01:00)] StatusCodeError: 403 - "<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n</body>\r\n</html>\r\n" [Tue Mar 02 2021 17:05:02 GMT+0100 (GMT+01:00)] StatusCodeError: 503 - "<!DOCTYPE html>\n\t<html>\n\t <head>\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t\t<meta charset=\"utf-8\">\n\t\t<title>Application Error</title>\n\t\t<style media=\"screen\">\n\t\t html,body,iframe {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t }\n\t\t html,body {\n\t\t\theight: 100%;\n\t\t\toverflow: hidden;\n\t\t }\n\t\t iframe {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tborder: 0;\n\t\t }\n\t\t</style>\n\t </head>\n\t <body>\n\t\t<iframe src=\"//www.herokucdn.com/error-pages/application-error.html\"></iframe>\n\t </body>\n\t</html>"

I guess the service behind used for fetching the IP is no longer active.

AAAA / ipv6 support

I am thinking about implementing AAAA / ipv6 support for this package but I'm not sure how best to go about it.

After research I'm finding that the current URL used for getting IP address is returning ipv4 only. (seems to be a current limitation with https://api.ipify.org. Supposedly fixed, but seems to be not functioning now)

Some thoughts to get the ball rolling --

Assertions

  • Some hosts will only have ipv6 addresses, and some will only have ipv4 so we can't assume that one or both will exist.

  • If only 'A' or 'AAAA' records exist then it might be nice to intelligently make the call to get the public IP for only the required type.

  • Separate api calls will need to be made to obtain each ip address since a single request can't be made over both ipv4 and ipv6 protocols simultaneously

  • Will need to gracefully handle a failed request for ip address since one or the other might not resolve

Specific Questions

  • Should ipv6 address be determined by an api call or by assuming an ipv6 address is the same as the public?

  • If an api should be used to obtain ipv6 address, what is a preferred alternative to ipify.org?

  • Should the address(s) be stored as JSON in a single ipfile or as strings in separate files?

Add api request to Godaddy API

Request template:

PATCH /v1/domains/{DOMAIN}/records HTTP/1.1
Host: api.godaddy.com
Content-Type: application/json
Authorization: sso-key {API_KEY}:{API_SECRET}

[
  {
    "type": "A",
    "name": "{SUBDOMAIN_NAME}",
    "data": "{IP_ADDRESS}",
    "ttl": 1
  }
]

TypeError while launching it

Hi!
I'm sorry to bother you again. I just installed the latest version and created a config file like the following:

{
  "apiKey": "****",
  "secret": "****",
  "domain": "mydomain.com",
  "records": [
    {"type": "A", "name": "@", "ttl": 600}
  ]
}

Afterwards, I type godaddy-dns -c mydomain.com-config.json and an exception is thrown:

[Wed Nov 29 2017 19:30:57 GMT+0100 (CET)] TypeError: Promise.resolve(...).each is not a function

PS: My godaddy keys are production's.

Thank you again!

Usage failure

After installing godaddy-dns, I can't execute it. I typed:
$ sudo npm install -g godaddy-dns
/usr/local/bin/godaddy-dns -> /usr/local/lib/node_modules/godaddy-dns/godaddy-dns.
/usr/local/lib
โ””โ”€โ”ฌ [email protected]
โ”œโ”€โ”€ [email protected]
โ””โ”€โ”ฌ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ””โ”€โ”€ [email protected]
โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ””โ”€โ”€ [email protected]

Then, I run $ godaddy-dns -V returning the following exception:
`module.js:471
throw err;
^

Error: Cannot find module 'request-promise'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/godaddy-dns/godaddy-dns.js:9:17)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)`

How can I solve it?

Installed NodeJS version is v6.11.4 and NPM's 3.5.2. I'm running Ubuntu 17.10 Desktop 64 bit.

Thanks.

Add Support For Multiple Domains

It would be nice to see support for multiple domains. The config-file could stay mostly the same, we simply would need a second array spanning around the domain already.

Support environment variables for apiKey and secret config

apiKey and secret options in the config file should be made optional and default to something like process.env.GODADDY_DNS_API_KEY and process.env.GODADDY_DNS_SECRET respectively.

This will allow to have an alternative (and more secure) way to provide those values.

Got an error when using "@"

Here's the relevant line from my JSON:
"records": [{"type": "A", "name": "@", "ttl": 600}]

$ godaddy-dns
[Sat May 21 2016 13:40:35 GMT-0400 (EDT)] Failed request to GoDaddy Api Another record with the same attributes already exists

When I changed "@" to "foo", it created the A record with no problem.

Also noticed that if I change the IP of "foo" on GoDaddy's website to something bogus then re-rerun godaddy-dns, it does not update the IP address and there is no error message.

cannot set 2 A records

My config:

{
  "apiKey":"xxx",
  "secret":"xxx",
  "domain":"example.com",
  "records":[
    {"name":"cloud1","type":"A","ttl":3600},
    {"name":"ltc","type":"A","ttl":3600}
  ]
}

when I run this I see:

[Mon Oct 10 2016 10:49:43 GMT+0000 (UTC)] Failed request to GoDaddy Api Another record with the same attributes already exists

The "ltc" record does get properly set, but not "cloud1". Basically, I want 2 A records pointing to the same IP. Any thoughts?

cronjob not working.

Log file output:

/bin/sh: 1: godaddy-dns: not found

which godaddy-dns
/usr/local/bin/godaddy-dns

cronjob:

*/5 * * * * godaddy-dns > /var/log/godaddy-dns.log 2>&1

cronjob installed under root user.

any ideas?

if I type

godaddy-dns
[Tue Jul 03 2018 12:19:10 GMT+0300 (EEST)] Current ip and last ip match. No update neccessary.

Thanks.

External IP address as optional argument

I'd like to have this option since I'm using multiple network interfaces on the same device (resulting in multiple external ip addresses). I'd be nice to add the external IP address as an optional argument if you'd like to set it manually.

Thanks in advance!

DNS record update

Hi,

I didn't understand where should I need to add the new value to be updated.
For example, Let's say that this is my configuration file content:
{
"apiKey": "some_api_key_values",
"secret": ""some_secret_values,
"domain": "mydomain.com",
"records": [{"type": "CNAME", "name": "mysubdomain", "ttl": 600}]
}

I want to update the CNAME value (which means destination value) and I didn't find where should I add it.
If you could share with me a full configuration file it would be better.
Please help.

Thanks.

Error related to "request" library prevents use

$ node --version
v9.2.1

$ sudo npm install godaddy-dns -g
/usr/local/bin/godaddy-dns -> /usr/local/lib/node_modules/godaddy-dns/src/cli.js
+ [email protected]
updated 1 package in 6.052s

$ godaddy-dns -v

###
### The "request" library is not installed automatically anymore.
### But required by "request-promise".
###
### npm install request --save
###

/usr/local/lib/node_modules/godaddy-dns/node_modules/aws4/lru.js:1
(function (exports, require, module, __filename, __dirname) {


SyntaxError: Invalid or unexpected token
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:152:10)
    at Module._compile (module.js:605:28)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/godaddy-dns/node_modules/aws4/aws4.js:5:11)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/godaddy-dns/node_modules/request/request.js:11:12)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)

"message":"is not a array"

Since a week ago the script won't accept the record array in the config file anymore. Here is the exact error output:

StatusCodeError: 422 - {"code":"INVALID_BODY","fields":[{"code":"UNEXPECTED_TYPE","message":"is not a array","path":"records"}],"message":"Request body doesn't fulfill schema, see details in fields"}

And here is the code auf my conf.json:

{ "apiKey":"xyz", "secret":"abc", "domain":"domain.xyz", "records":[ { "type":"A", "name":"@", "ttl":600 } ] }

Testet on different machines with clean installation. Thank you!

Duplicating DNS records

Hi,

Thx for great work.

I'm updating host with "godaddy-dns -c config.json -i last.ip".

Config.json:

{
"apiKey": "xxxxxxxxxxxxxxxxxxxxx",
"secret": "yyyyyyyyyyyyyyyyyyyyyy",
"domain": "domain.com",
"records": [{"type": "A", "name": "subdomain", "ttl": 600}]
}

After few updates, I noticed that I have many (same as update times) subdomains in godaddy DNS manager. I thought that expected behaviour should be ONE subdomain with last IP, NOT 10 same subdomains with different IPs.

GoDaddy DNS Management excerpt:

Type Name Value TTL Actions
A @ 0.0.0.0 1/2 Hour Edit
A subdomain 00.00.00.00 1 Hour Edit
A subdomain 00.00.00.00 1 Hour Edit
A subdomain 00.00.00.00 1 Hour Edit
A subdomain 00.00.00.00 1 Hour Edit
A subdomain 00.00.00.00 1 Hour Edit
A subdomain 00.00.00.00 1 Hour Edit
A subdomain 00.00.00.00 1 Hour Edit
A subdomain 00.00.00.00 1 Hour Edit
A subdomain 00.00.00.00 1 Hour Edit
NS @ ns11.domaincontrol.com 1 Hour
NS @ ns12.domaincontrol.com 1 Hour

Am I missing something obvious???

Thank you

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.