In net/dns/header.rb, constants are defined only for QUERY, IQUERY and STATUS opcodes. Please define it for NOTIFY and UPDATE also :
0 QUERY, Standard query. RFC 1035
1 IQUERY, Inverse query. RFC 1035, RFC 3425
2 STATUS, Server status request. RFC 1035
3 reserved.
4 Notify. RFC 1996
5 Update. RFC 2136
6 - 15 reserved.