Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
do-dns-update
Advanced tools
Update a dns record through the DigitalOcean API.
Personally im using it to make sure that my gaming server that is sitting behind a dynamic IP got a working subdomain pointing to it :)
npm install do-dns-update
As simple as it gets, you won't really know if the change went through or not. Check out the return object below the example code.
const api_key = 'bd17aec......ec8'; // API key from Digital Ocean (https://cloud.digitalocean.com/account/api/)
const Updater = require('do-dns-update');
(async () => {
try {
const updater = new Updater(api_key);
await updater.setIP('game', 'example.com'); //Sets the ip of game.example.com to your currently external resolved IP.
} catch (error) {
console.log(error);
}
})();
setIP() returns an object that you can access to figure out if the change went through or not.
{
success: true/false
subdomain: affected subdomain with domain.
ip: the ip that got set
message: short message, could be that an update was done, failed or didnt run because it is already pointing to the same ip.
}
Sets the IP for a specific subdomain, will default to resolving your current external IP if none is supplied.
(using ipinfo.io as resolver).
@param {string} subdomain - The record/subdomain we want to set IP on.
@param {string} domain - The domain we want to set IP on.
@param {string} [ip=null] - Optional IP to set if you what to use a specific IP and not your current external IP.
@param {boolean} [debug=false] - Optional boolean to display some console logs.
FAQs
Update a dns record through the DigitalOcean API
We found that do-dns-update demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.