Jit of aliases working

This commit is contained in:
Owen
2026-03-12 17:26:46 -07:00
parent e326da3d3e
commit c2b5ef96a4
4 changed files with 39 additions and 23 deletions

View File

@@ -75,8 +75,18 @@ func (s *DNSRecordStore) AddRecord(domain string, ip net.IP, siteId int) error {
}
rs := m[domain]
if isV4 {
for _, existing := range rs.A {
if existing.Equal(ip) {
return nil
}
}
rs.A = append(rs.A, ip)
} else {
for _, existing := range rs.AAAA {
if existing.Equal(ip) {
return nil
}
}
rs.AAAA = append(rs.AAAA, ip)
}
@@ -87,6 +97,7 @@ func (s *DNSRecordStore) AddRecord(domain string, ip net.IP, siteId int) error {
return nil
}
// AddPTRRecord adds a PTR record mapping an IP address to a domain name
// ip should be a valid IPv4 or IPv6 address
// domain should be in FQDN format (e.g., "example.com.")