diff --git a/src/dns/namecom.js b/src/dns/namecom.js index 65c284a47..786052abb 100644 --- a/src/dns/namecom.js +++ b/src/dns/namecom.js @@ -54,6 +54,10 @@ function addRecord(dnsConfig, zoneName, name, type, values, callback) { if (type === 'MX') { data.priority = parseInt(values[0].split(' ')[0], 10); data.answer = values[0].split(' ')[1]; + } else if (type === 'TXT') { + // we have to strip the quoting for some odd reason for name.com! If you change that also change updateRecord + let tmp = values[0]; + data.answer = tmp.indexOf('"') === 0 && tmp.lastIndexOf('"') === tmp.length-1 ? tmp.slice(1, tmp.length-1) : tmp; } else { data.answer = values[0]; } @@ -91,6 +95,10 @@ function updateRecord(dnsConfig, zoneName, recordId, name, type, values, callbac if (type === 'MX') { data.priority = parseInt(values[0].split(' ')[0], 10); data.answer = values[0].split(' ')[1]; + } else if (type === 'TXT') { + // we have to strip the quoting for some odd reason for name.com! If you change that also change addRecord + let tmp = values[0]; + data.answer = tmp.indexOf('"') === 0 && tmp.lastIndexOf('"') === tmp.length-1 ? tmp.slice(1, tmp.length-1) : tmp; } else { data.answer = values[0]; }