Ejemplo n.º 1
0
func QTYPE(d dns.DNS, num int) {
	field, err := d.GetQTYPE(num)

	if err != nil {
		fmt.Println(err.Error(), "\n")
		return
	}

	fmt.Printf("QTYPE: ")
	switch field {
	case 1:
		fmt.Println("A")
	case 2:
		fmt.Println("NS")
	case 3:
		fmt.Println("MD")
	case 4:
		fmt.Println("MF")
	case 5:
		fmt.Println("CNAME")
	case 6:
		fmt.Println("SOA")
	case 7:
		fmt.Println("MB")
	case 8:
		fmt.Println("MG")
	case 9:
		fmt.Println("MR")
	case 10:
		fmt.Println("NULL")
	case 11:
		fmt.Println("WKS")
	case 12:
		fmt.Println("PTR")
	case 13:
		fmt.Println("HINFO")
	case 14:
		fmt.Println("MINFO")
	case 15:
		fmt.Println("MX")
	case 16:
		fmt.Println("TXT")
	case 28:
		fmt.Println("AAAA")
	case 252:
		fmt.Println("AXFR")
	case 253:
		fmt.Println("MAILB")
	case 254:
		fmt.Println("MAILA")
	case 255:
		fmt.Println("*")
	default:
		fmt.Printf("NOT VALID %d \n", field)
	}
}