domains: add option to set custom/vanity nameservers
this flag skips the NS name validation when a custom nameserver is set i.e not to the provider's NS but uses the provider's API.
This commit is contained in:
+4
-2
@@ -219,10 +219,12 @@ async function verifyDomainConfig(domainObject) {
|
||||
|
||||
if (typeof domainConfig.username !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'username must be a string');
|
||||
if (typeof domainConfig.token !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'token must be a string');
|
||||
if ('customNameservers' in domainConfig && typeof domainConfig.customNameservers !== 'boolean') throw new BoxError(BoxError.BAD_FIELD, 'customNameservers must be a boolean');
|
||||
|
||||
const credentials = {
|
||||
username: domainConfig.username,
|
||||
token: domainConfig.token
|
||||
token: domainConfig.token,
|
||||
customNameservers: !!domainConfig.customNameservers
|
||||
};
|
||||
|
||||
const ip = '127.0.0.1';
|
||||
@@ -235,7 +237,7 @@ async function verifyDomainConfig(domainObject) {
|
||||
|
||||
if (!nameservers.every(function (n) { return n.toLowerCase().indexOf('.name.com') !== -1; })) {
|
||||
debug('verifyDomainConfig: %j does not contain Name.com NS', nameservers);
|
||||
throw new BoxError(BoxError.BAD_FIELD, 'Domain nameservers are not set to name.com');
|
||||
if (!domainConfig.customNameservers) throw new BoxError(BoxError.BAD_FIELD, 'Domain nameservers are not set to name.com');
|
||||
}
|
||||
|
||||
const location = 'cloudrontestdns';
|
||||
|
||||
Reference in New Issue
Block a user