diff --git a/src/dns/waitfordns.js b/src/dns/waitfordns.js index 582d26e92..8d3a1204c 100644 --- a/src/dns/waitfordns.js +++ b/src/dns/waitfordns.js @@ -7,7 +7,8 @@ const assert = require('assert'), debug = require('debug')('box:dns/waitfordns'), dig = require('../dig.js'), promiseRetry = require('../promise-retry.js'), - safe = require('safetydance'); + safe = require('safetydance'), + _ = require('underscore'); async function resolveIp(hostname, type, options) { assert.strictEqual(typeof hostname, 'string'); @@ -20,12 +21,12 @@ async function resolveIp(hostname, type, options) { if (!error && results.length !== 0) return results; // try CNAME record at authoritative server - debug(`resolveIp: Checking if ${hostname} has CNAME record at ${options.server}`); + debug(`resolveIp: No A record. Checking if ${hostname} has CNAME record at ${options.server}`); const cnameResults = await dig.resolve(hostname, 'CNAME', options); if (cnameResults.length === 0) return cnameResults; // recurse lookup the CNAME record - debug(`resolveIp: Resolving ${hostname}'s CNAME record ${cnameResults[0]}`); + debug(`resolveIp: CNAME record found. Resolving ${hostname}'s CNAME record ${cnameResults[0]} using unbound`); return await dig.resolve(cnameResults[0], type, options); }