diff --git a/src/dns/namecheap.js b/src/dns/namecheap.js index c145ca1f0..0729e149d 100644 --- a/src/dns/namecheap.js +++ b/src/dns/namecheap.js @@ -57,8 +57,8 @@ async function getZone(domainConfig, zoneName) { const query = await getQuery(domainConfig); query.Command = 'namecheap.domains.dns.getHosts'; - query.SLD = zoneName.split('.')[0]; - query.TLD = zoneName.split('.')[1]; + query.SLD = zoneName.split('.', 1)[0]; + query.TLD = zoneName.slice(query.SLD.length + 1); const [error, response] = await safe(superagent.get(ENDPOINT).query(query).ok(() => true)); if (error) throw new BoxError(BoxError.NETWORK_ERROR, error.message);