(host string, addr net.IP)
| 415 | } |
| 416 | |
| 417 | func newIPDNSResponse(host string, addr net.IP) *dns.Msg { |
| 418 | request := new(dns.Msg).SetQuestion(host, dns.TypeA) |
| 419 | response := new(dns.Msg).SetReply(request) |
| 420 | response.Answer = append(response.Answer, &dns.A{ |
| 421 | Hdr: dns.RR_Header{ |
| 422 | Name: host, |
| 423 | Rrtype: dns.TypeA, |
| 424 | Class: dns.ClassINET, |
| 425 | Ttl: 30, |
| 426 | Rdlength: 4, |
| 427 | }, |
| 428 | A: addr, |
| 429 | }) |
| 430 | |
| 431 | return response |
| 432 | } |
| 433 | |
| 434 | func newCnameDNSResponse(host string, target string) *dns.Msg { |
| 435 | request := new(dns.Msg).SetQuestion(host, dns.TypeCNAME) |
no outgoing calls
no test coverage detected