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:
Girish Ramakrishnan
2025-03-02 07:27:09 +01:00
parent 085ed59334
commit 6aca198428
28 changed files with 156 additions and 61 deletions
+4 -2
View File
@@ -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';