feat(dnssec): Add MX record DNSSEC support for proper serialization and authentication of mail exchange records

This commit is contained in:
2025-06-01 20:53:22 +00:00
parent afdd6a6074
commit 9e5fae055f
4 changed files with 21 additions and 1 deletions

View File

@ -809,6 +809,12 @@ export class DnsServer {
minimum.writeUInt32BE(data.minimum, 0);
return Buffer.concat([mname, rname, serial, refresh, retry, expire, minimum]);
case 'MX':
// MX records contain preference (16-bit) and exchange (domain name)
const preference = Buffer.alloc(2);
preference.writeUInt16BE(data.preference, 0);
const exchange = this.nameToBuffer(data.exchange);
return Buffer.concat([preference, exchange]);
// Add cases for other record types as needed
default:
throw new Error(`Serialization for record type ${type} is not implemented.`);