lmammino / godaddy-dns

A Node.js script to programmatically update GoDaddy DNS records
https://lmammino.github.io/godaddy-dns/
MIT License
78 stars 21 forks source link

Critical Bug Fixes #11

Closed tkambler closed 8 years ago

tkambler commented 8 years ago

Thanks for putting this together - it's super useful and allows me to avoid paying for DynDNS.

This PR fixes a critical bug that - so far as I can tell - completely prevents DNS updates from taking place when you provide an array of changes. For example, consider the following config file:

{
    "apiKey": "...",
    "secret": "...",
    "domain": "domain.com",
    "records": [
        {
            "type": "A",
            "name": "home",
            "ttl": 600
        },
        {
            "type": "A",
            "name": "chat",
            "ttl": 600
        },
        {
            "type": "A",
            "name": "cloud",
            "ttl": 600
        }
    ]
}

As it stands, when I run this utility, GoDaddy reports the following error:

Another record with the same attributes already exists.

This is the result (in part) of incorrect usage of Node's (deprecated) util._extend() method.