Using Alias Records breaks DNSControl (#616)

This commit is contained in:
Vatsalya Goel 2020-02-08 06:25:08 +11:00 committed by GitHub
parent 6c4192bf82
commit d2625cf17a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -266,20 +266,24 @@ func nativeToRecords(set *adns.RecordSet, origin string) []*models.RecordConfig
var results []*models.RecordConfig
switch rtype := *set.Type; rtype {
case "Microsoft.Network/dnszones/A":
for _, rec := range *set.ARecords {
rc := &models.RecordConfig{TTL: uint32(*set.TTL)}
rc.SetLabelFromFQDN(*set.Fqdn, origin)
rc.Type = "A"
_ = rc.SetTarget(*rec.Ipv4Address)
results = append(results, rc)
if *set.ARecords != nil {
for _, rec := range *set.ARecords {
rc := &models.RecordConfig{TTL: uint32(*set.TTL)}
rc.SetLabelFromFQDN(*set.Fqdn, origin)
rc.Type = "A"
_ = rc.SetTarget(*rec.Ipv4Address)
results = append(results, rc)
}
}
case "Microsoft.Network/dnszones/AAAA":
for _, rec := range *set.AaaaRecords {
rc := &models.RecordConfig{TTL: uint32(*set.TTL)}
rc.SetLabelFromFQDN(*set.Fqdn, origin)
rc.Type = "AAAA"
_ = rc.SetTarget(*rec.Ipv6Address)
results = append(results, rc)
if *set.AaaaRecords != nil {
for _, rec := range *set.AaaaRecords {
rc := &models.RecordConfig{TTL: uint32(*set.TTL)}
rc.SetLabelFromFQDN(*set.Fqdn, origin)
rc.Type = "AAAA"
_ = rc.SetTarget(*rec.Ipv6Address)
results = append(results, rc)
}
}
case "Microsoft.Network/dnszones/CNAME":
rc := &models.RecordConfig{TTL: uint32(*set.TTL)}