code: function writeNaptr(buff, val, label_index) {
    assertUndefined(val.order, 'NAPTR record requires "order"');
    assertUndefined(val.preference, 'NAPTR record requires "preference"');
    assertUndefined(val.flags, 'NAPTR record requires "flags"');
    assertUndefined(val.service, 'NAPTR record requires "service"');
    assertUndefined(val.regexp, 'NAPTR record requires "regexp"');
    assertUndefined(val.replacement, 'NAPTR record requires "replacement"');
    buff.writeUInt16BE(val.order & 0xFFFF);
    buff.writeUInt16BE(val.preference & 0xFFFF);
    buff.writeUInt8(val.flags.length);
    buff.write(val.flags, val.flags.length, 'ascii');
    buff.writeUInt8(val.service.length);
    buff.write(val.service, val.service.length, 'ascii');
    buff.writeUInt8(val.regexp.length);
    buff.write(val.regexp, val.regexp.length, 'ascii');
    namePack(val.replacement, buff, label_index);
    return WRITE_RESOURCE_DONE;
  }
docs: http://tools.ietf.org/html/rfc3403#section-4.1