Skip to content

J-Chaniotis/freedns-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

freedns-api

Dependency Status npm version

A node.js wrapper around freedns.afraid.org API

Installation

npm install freedns-api

Usage

'use strict';
const freednsApi = require('freedns-api');
(async () => {
    /**
     *  Wrap everything inside a try-catch block.
     *  if there is invalid configuration or network problems an error will be thrown
     */
    try {

        // Get a list of all account dns records
        const entries = await freednsApi.getdyndns({
            username: 'BruceWayne',
            password: 'B@tM@n'
        });

        // Update the first record with a user provided ip address
        const status = await freednsApi.update({
            updateUrl: entries[0].updateUrl, // This value can be obtained directly from the website
            address: '10.10.21.11' // This is optional, if not used, the ip will be detected automatically
        });

        console.log(status);

    } catch (error) {
        console.error(error);
    }
    
})();

License

MIT

About

A node.js wrapper around freedns.afraid.org API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published