Documentation
¶
Index ¶
Constants ¶
View Source
const ( // QType ARecord QType = 1 NameServer QType = 2 CName QType = 5 SOA QType = 6 WKS QType = 11 PTR QType = 12 HInfo QType = 13 MInfo QType = 14 MX QType = 15 TXT QType = 16 // QClass QCIN QClass = 1 QCCH QClass = 3 QCHS QClass = 4 OpCodeStandard OpCode = 0 OpCodeInverse OpCode = 1 << 12 ServerStatus OpCode = 1 << 13 AA uint16 = 1 << 10 TC uint16 = 1 << 9 RD uint16 = 1 << 8 RA uint16 = 1 << 7 QRResponseFlag uint16 = 1 << 15 RCodeNoError uint16 = 0 RCodeFormaterror uint16 = 1 RCodeServerFailure uint16 = 2 RCodeNameError uint16 = 3 RCodeNotImplemented uint16 = 4 RCodeRefused uint16 = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DNSHeader ¶
type DNSHeader struct {
ID uint16
MiscFlags uint16
QDCount uint16
ANCount uint16
NSCount uint16
ADCount uint16
}
DNSHeader... first 12 bytes of the UDP packet. See https://routley.io/tech/2017/12/28/hand-writing-dns-messages.html for great explanation about this!
type DNSQuestion ¶
func (DNSQuestion) ToString ¶
func (q DNSQuestion) ToString() string
type DNSRequest ¶
type DNSRequest struct {
QuerySlice []DNSQuestion
}
DNSRequest is DNS Request (duh). Within a single request there can actually be multiple domains to lookup.
type DNSResourceRecord ¶
type DNSResourceRecord struct {
DomainName string
QType QType
QClass QClass
TTL uint32
DataLength uint16
Data []byte
}
DNSResourceRecord used for answers, authority records and additional records
func (DNSResourceRecord) ToString ¶
func (r DNSResourceRecord) ToString() string
type RawDNSRequest ¶
RawDNSRequest is the raw information from the socket. This includes the byte array and the client details of the request (so we know where to respond to).
Click to show internal directories.
Click to hide internal directories.