Skip to content

Commit

Permalink
Added apex variable
Browse files Browse the repository at this point in the history
  • Loading branch information
networkop committed Nov 6, 2020
1 parent aa80a27 commit ad4af2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apex.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ func (gw *Gateway) serveApex(state request.Request) (int, error) {
m.SetReply(state.Req)
switch state.QType() {
case dns.TypeSOA:
m.Authoritative = true // For some reason this flag is not set on the first non-cached response ?
m.Answer = []dns.RR{gw.soa(state)}
m.Ns = []dns.RR{gw.ns(state)} // This fixes some of the picky DNS resolvers
case dns.TypeNS:
m.Answer = []dns.RR{gw.ns(state)}

Expand Down
6 changes: 6 additions & 0 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ func parse(c *caddy.Controller) (*Gateway, error) {
return nil, c.Errf("ttl must be in range [0, 3600]: %d", t)
}
gw.ttlLow = uint32(t)
case "apex":
args := c.RemainingArgs()
if len(args) == 0 {
return nil, c.ArgErr()
}
gw.apex = args[0]
default:
return nil, c.Errf("Unknown property '%s'", c.Val())
}
Expand Down

0 comments on commit ad4af2c

Please sign in to comment.