3 exports.toString = function (type) {
8 case 18: return 'AFSDB'
10 case 257: return 'CAA'
11 case 60: return 'CDNSKEY'
13 case 37: return 'CERT'
14 case 5: return 'CNAME'
15 case 49: return 'DHCID'
16 case 32769: return 'DLV'
17 case 39: return 'DNAME'
18 case 48: return 'DNSKEY'
21 case 13: return 'HINFO'
22 case 45: return 'IPSECKEY'
27 case 35: return 'NAPTR'
29 case 47: return 'NSEC'
30 case 50: return 'NSEC3'
31 case 51: return 'NSEC3PARAM'
33 case 46: return 'RRSIG'
39 case 44: return 'SSHFP'
40 case 32768: return 'TA'
41 case 249: return 'TKEY'
42 case 52: return 'TLSA'
43 case 250: return 'TSIG'
45 case 252: return 'AXFR'
46 case 251: return 'IXFR'
48 case 255: return 'ANY'
49 case 65: return 'HTTPS'
51 return 'UNKNOWN_' + type
54 exports.toType = function (name) {
55 switch (name.toUpperCase()) {
57 case 'NULL': return 10
58 case 'AAAA': return 28
59 case 'AFSDB': return 18
61 case 'CAA': return 257
62 case 'CDNSKEY': return 60
64 case 'CERT': return 37
65 case 'CNAME': return 5
66 case 'DHCID': return 49
67 case 'DLV': return 32769
68 case 'DNAME': return 39
69 case 'DNSKEY': return 48
72 case 'HINFO': return 13
73 case 'IPSECKEY': return 45
78 case 'NAPTR': return 35
80 case 'NSEC': return 47
81 case 'NSEC3': return 50
82 case 'NSEC3PARAM': return 51
84 case 'RRSIG': return 46
90 case 'SSHFP': return 44
91 case 'TA': return 32768
92 case 'TKEY': return 249
93 case 'TLSA': return 52
94 case 'TSIG': return 250
96 case 'AXFR': return 252
97 case 'IXFR': return 251
99 case 'ANY': return 255
100 case 'HTTPS': return 65
103 if (name.toUpperCase().startsWith('UNKNOWN_')) return parseInt(name.slice(8))