Skip to content

Commit

Permalink
Use CNAME for AIA MetaDomain
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Feb 8, 2021
1 parent b376560 commit 29324a0
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,6 @@ func (tx *btx) doMetaDomain() (rrs []dns.RR, err error) {
return nil, fmt.Errorf("invalid value specified for SelfIP")
}

// TODO: Make AIA address configurable
if tx.subname == "aia" {
tx.subname = "this"
}

switch tx.subname {
case "this":
rrs = []dns.RR{
Expand All @@ -257,6 +252,19 @@ func (tx *btx) doMetaDomain() (rrs []dns.RR, err error) {
A: ip,
},
}
case: "aia":
// TODO: Make AIA address configurable (currently hardcoded to "this.x--nmc.bit")
rrs = []dns.RR{
&dns.CNAME{
Hdr: dns.RR_Header{
Name: dns.Fqdn("aia." + tx.basename + "." + tx.rootname),
Ttl: 86400,
Class: dns.ClassINET,
Rrtype: dns.TypeCNAME,
},
Target: dns.Fqdn("this." + tx.basename + "." + tx.rootname),
},
}

default:
}
Expand Down

0 comments on commit 29324a0

Please sign in to comment.