The QType class lets you deal easily with the different kind of resource types, like ‘A’, ‘NS’, ‘CNAME’, etc. These types have both a name and a number. This class helps seamlessly move between them.
QType¶newQType(name) → QType¶Returns a new QType object from name. Name can either contain the code of the type prefixed with a sharp character, or its name directly
| Parameters: | name (string) – The name of the QType |
|---|
type = newQType("CNAME")
anothertype = newQType("#5")
if type == anothertype then -- prints "equal!"
print('equal!')
end
QType¶It has these methods:
QType:getCode() -> intReturns the numeric code corresponding to the type
QType:getName() -> stringReturns the name of the type