Class | Net::DNS::Header::RCode |
In: |
lib/net/dns/header.rb
|
Parent: | Object |
Net::DNS::Header::RCode - DNS Header RCode handling class
It should be used internally by Net::DNS::Header class. However, it‘s still possible to instantiate it directly.
require 'net/dns/header' rcode = Net::DNS::Header::RCode.new 0
The RCode class represents the RCode field in the Header portion of a DNS packet. This field (called Response Code) is used to get informations about the status of a DNS operation, such as a query or an update. These are the values in the original Mockapetris‘s standard (RFC1035):
the query.
unable to process this query due to a problem with the name server.
responses from an authoritative name server, this code means that the domain name referenced in the query does not exist.
not support the requested kind of query.
perform the specified operation for policy reasons. For example, a name server may not wish to provide the information to the particular requester, or a name server may not wish to perform a particular operation (e.g., zone transfer) for particular data.
In the next DNS RFCs, codes 6-15 has been assigned to the following errors:
More RCodes has to come for TSIGs and other operations.
NOERROR | = | 0 | Constant for rcode Response Code No Error | |
FORMAT | = | 1 | Constant for rcode Response Code Format Error | |
SERVER | = | 2 | Constant for rcode Response Code Server Format Error | |
NAME | = | 3 | Constant for rcode Response Code Name Error | |
NOTIMPLEMENTED | = | 4 | Constant for rcode Response Code Not Implemented Error | |
REFUSED | = | 5 | Constant for rcode Response Code Refused Error | |
RCodeType | = | %w[NoError FormErr ServFail NXDomain NotImp Refused YXDomain YXRRSet NXRRSet NotAuth NotZone] | ||
RCodeErrorString | = | ["No errors", "The name server was unable to interpret the query", "The name server was unable to process this query due to problem with the name server", "Domain name referenced in the query does not exists", "The name server does not support the requested kind of query", "The name server refuses to perform the specified operation for policy reasons", "", "", "", "", ""] |
code | [R] | |
explanation | [R] | |
type | [R] |