Skip to content

Commit

Permalink
powerdns: Notify secondaries after zone updates
Browse files Browse the repository at this point in the history
  • Loading branch information
esclear committed Jul 17, 2022
1 parent 6a53daa commit de3d3ad
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions providers/dns/pdns/pdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"net/http"
"net/url"
"path"
"time"

"github.com/go-acme/lego/v4/challenge/dns01"
Expand Down Expand Up @@ -172,6 +173,14 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
if err != nil {
return fmt.Errorf("pdns: %w", err)
}

if d.apiVersion >= 1 {
p := path.Join(zone.URL, "/notify")
_, err = d.sendRequest(http.MethodPut, p, nil)
if err != nil {
return fmt.Errorf("pdns: %w", err)
}
}
return nil
}

Expand Down Expand Up @@ -210,5 +219,13 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
if err != nil {
return fmt.Errorf("pdns: %w", err)
}

if d.apiVersion >= 1 {
p := path.Join(zone.URL, "/notify")
_, err = d.sendRequest(http.MethodPut, p, nil)
if err != nil {
return fmt.Errorf("pdns: %w", err)
}
}
return nil
}

0 comments on commit de3d3ad

Please sign in to comment.