Skip to content

Instantly share code, notes, and snippets.

@suresh-sendinblue
Created May 16, 2023 10:07
Show Gist options
  • Save suresh-sendinblue/2bf08097462010c2770abd12333b8ac3 to your computer and use it in GitHub Desktop.
Save suresh-sendinblue/2bf08097462010c2770abd12333b8ac3 to your computer and use it in GitHub Desktop.
const dns = require('dns')
client_id=parseInt(process.argv[2] || 'xxxxxx')
function callMe() {
const strToExec = 'emailing.' + client_id + '.connectionstring.v2.production.cache.sib.';
dns.resolveTxt(strToExec, (error, stdout) => {
stdout = stdout && stdout[0] && stdout[0][0]
if (error || !stdout) {
console.log('some error occured while trying to get connection string from DNS cache' + error)
return error, stdout
}
if (stdout === '_NOT_FOUND_') {
console.log('connection string not found')
stdout = null
}
console.log(stdout)
callMe()
})
}
callMe()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment