mafintosh / dns-packet

An abstract-encoding compliant module for encoding / decoding DNS packets
MIT License
201 stars 70 forks source link

Add constant for NXDOMAIN #64

Open nhnt11 opened 3 years ago

nhnt11 commented 3 years ago

Trivially OR'ing 0x03 to the flags works to set NXDOMAIN in the response header. Exposing a constant for this makes it accessible and obvious.

silverwind commented 2 years ago

I think instead of exporting this one rcode, we could instead export the toRcode function to make them all accessible. Maybe name it stringToRcode to also allow the reverse to be cleanly exported as rcodeToString.