Skip to content

Commit

Permalink
Merge pull request grandcat#44 from tmm1/compression
Browse files Browse the repository at this point in the history
Enable Name Compression
  • Loading branch information
grandcat authored Dec 20, 2018
2 parents df75bb3 + 63665f9 commit ce4c7ef
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 ce4c7ef

Please sign in to comment.