MCPcopy
hub / github.com/grafana/dskit / newIPDNSResponse

Function newIPDNSResponse

dns/miekgdns/resolver_test.go:417–432  ·  view source on GitHub ↗
(host string, addr net.IP)

Source from the content-addressed store, hash-verified

415}
416
417func 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
434func newCnameDNSResponse(host string, target string) *dns.Msg {
435 request := new(dns.Msg).SetQuestion(host, dns.TypeCNAME)

Callers 1

TestResolver_LookupIPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected