Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust TTLs #46

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion acme/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ type acmeReader struct {
Datastore datastore.Datastore
}

const ttl = 1 * time.Hour
// The TTL for the _acme-challenge TXT record is as short as possible, typically 60 seconds or less.
const ttl = 60 * time.Second

// ServeDNS implements the plugin.Handler interface.
func (p acmeReader) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
Expand Down
6 changes: 3 additions & 3 deletions e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func TestSetACMEChallenge(t *testing.T) {
if r.Rcode != dns.RcodeSuccess || len(r.Answer) == 0 {
t.Fatalf("Expected successful reply, got %s", dns.RcodeToString[r.Rcode])
}
expectedAnswer := fmt.Sprintf(`%s 3600 IN TXT "%s"`, m.Question[0].Name, testChallenge)
expectedAnswer := fmt.Sprintf(`%s 60 IN TXT "%s"`, m.Question[0].Name, testChallenge)
if r.Answer[0].String() != expectedAnswer {
t.Fatalf("Expected %s reply, got %s", expectedAnswer, r.Answer[0].String())
}
Expand Down Expand Up @@ -363,7 +363,7 @@ func TestIPv4Lookup(t *testing.T) {
return
}

expectedAnswer := fmt.Sprintf(`%s 86400 IN A %s`, m.Question[0].Name, tt.expectedAddress)
expectedAnswer := fmt.Sprintf(`%s 604800 IN A %s`, m.Question[0].Name, tt.expectedAddress)
if r.Answer[0].String() != expectedAnswer {
t.Fatalf("Expected %s reply, got %s", expectedAnswer, r.Answer[0].String())
}
Expand Down Expand Up @@ -480,7 +480,7 @@ func TestIPv6Lookup(t *testing.T) {
return
}

expectedAnswer := fmt.Sprintf(`%s 86400 IN AAAA %s`, m.Question[0].Name, tt.expectedAddress)
expectedAnswer := fmt.Sprintf(`%s 604800 IN AAAA %s`, m.Question[0].Name, tt.expectedAddress)
if r.Answer[0].String() != expectedAnswer {
t.Fatalf("Expected %s reply, got %s", expectedAnswer, r.Answer[0].String())
}
Expand Down
4 changes: 3 additions & 1 deletion ipparser/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ type ipParser struct {
ForgeDomain string
}

const ttl = 24 * time.Hour
// The TTL for self-referential ip.peerid.etld A/AAAA records can be as long as possible.
// We will be increasing this over time, as infrastructure ossifies.
const ttl = 7 * 24 * time.Hour

// ServeDNS implements the plugin.Handler interface.
func (p ipParser) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
Expand Down
5 changes: 1 addition & 4 deletions zones/libp2p.direct
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ORIGIN libp2p.direct.

;; SOA Records
@ 86400 IN SOA aws1.libp2p.direct. domains.ipshipyard.com. (
2025011601 ; serial
2025020101 ; serial
86400 ; refresh
2400 ; retry
604800 ; expire
Expand Down Expand Up @@ -42,9 +42,6 @@ ns1.libp2p.direct. 86400 IN AAAA 2604:2dc0:101:100::265
ns2.libp2p.direct. 86400 IN A 15.204.28.76
ns2.libp2p.direct. 86400 IN AAAA 2604:2dc0:202:200::64e

;; TODO: ns3 was renamed to aws1, fine to remove once we migrate away from ns1 as primary
ns3.libp2p.direct. 86400 IN CNAME aws1.libp2p.direct.

;; Limit allowed CAs to Let's Encrypt, we discussed feasibility with them and no concerns were raised:
;; https://community.letsencrypt.org/t/feedback-on-raising-certificates-per-registered-domain-to-enable-peer-to-peer-networking/223003
libp2p.direct. 86400 IN CAA 0 issue "letsencrypt.org"
Expand Down