Skip to content

A script that allows you to point a DNS to a non-static ip address

License

Notifications You must be signed in to change notification settings

cmseguin/dynamic-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Ip

Description

Just a simple script that pings a 3rd party to find out if your ip changed every x amount of time. If it changes, it will update specified domains and records.
*Currently only supports digital ocean

Installation

Create a file called config-local.js at the root of the project:

module.exports = {
    'debug': true,
    'digitalOceanToken': 'xxx',
    'domains': [
        {
            'domain': 'foo.com',
            'records': ['bar', 'baz']
        }
    ]
}

Then run:

npm install

Hooking it up with systemd

Clone the project in your home dir and install the dependencies:

cd ~
git clone git@gitlab.com:cmseguin/dynamic-ip.git
mv ~/dynamic-ip ~/.dynamic-ip
cd ~/.dynamic-ip
npm install --production

Create a file in /etc/systemd/system called dynamic-ip.service

[Unit]
Description=A script to update one or more domains record to point to a non-static ip address

[Service]
WorkingDirectory=/home/{user}
ExecStart=/usr/local/bin/node /home/{user}/.dynamic-ip/index.js
Restart=on-abort

[Install]
WantedBy=multi-user.target

About

A script that allows you to point a DNS to a non-static ip address

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published