1. DNS请求报文头
[]byte{0x01, 0b100000000, 1, 0, 0, 0}
2. 查询的域名 QNAME
func parseDomain(domain string) []byte {
var b = []byte{}
for _, s := range strings.Split(domain, ".") {
b = append(b, byte(len(s)))
b = append(b, []byte(s)...)
}
b = append(b, byte(0x00))
return b
}
3. 报文头尾部
[]byte{1, 1}