Skip to content

Commit

Permalink
rfc section 18.10: Name Compression
Browse files Browse the repository at this point in the history
implementations SHOULD use name compression wherever possible to compress the names of resource records
  • Loading branch information
tmm1 committed Oct 9, 2018
1 parent df75bb3 commit 63665f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func (s *Server) handleQuery(query *dns.Msg, ifIndex int, from net.Addr) error {
for _, q := range query.Question {
resp := dns.Msg{}
resp.SetReply(query)
resp.Compress = true
resp.RecursionDesired = false
resp.Authoritative = true
resp.Question = nil // RFC6762 section 6 "responses MUST NOT contain any questions"
Expand Down Expand Up @@ -557,6 +558,7 @@ func (s *Server) probe() {
resp := new(dns.Msg)
resp.MsgHdr.Response = true
// TODO: make response authoritative if we are the publisher
resp.Compress = true
resp.Answer = []dns.RR{}
resp.Extra = []dns.RR{}
s.composeLookupAnswers(resp, s.ttl, intf.Index, true)
Expand Down

0 comments on commit 63665f9

Please sign in to comment.