feat(dnssec): Add MX record DNSSEC support for proper serialization and authentication of mail exchange records
This commit is contained in:
@ -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.`);
|
||||
|
Reference in New Issue
Block a user