Browse Source

Need to set RR class in responses.

The lack of this (Class==0) worked fine with Google UDP and DoH, and
Cloudflare UDP, but failed with Cloudflare DoH (the DoH resolver
stripped the TXT RR).
David Fifield 6 years ago
parent
commit
0a568a386b
1 changed files with 5 additions and 4 deletions
  1. 5 4
      dnstt-server/main.go

+ 5 - 4
dnstt-server/main.go

@@ -377,10 +377,11 @@ func sendLoop(dnsConn net.PacketConn, ttConn *turbotunnel.QueuePacketConn, ch <-
 
 			rec.Resp.Answer = []dns.RR{
 				{
-					Name: rec.Resp.Question[0].Name,
-					Type: dns.RRTypeTXT,
-					TTL:  responseTTL,
-					Data: nil, // will be filled in below
+					Name:  rec.Resp.Question[0].Name,
+					Type:  rec.Resp.Question[0].Type,
+					Class: rec.Resp.Question[0].Class,
+					TTL:   responseTTL,
+					Data:  nil, // will be filled in below
 				},
 			}