Browse Source

add wildcard dns on free subdomain

master
forest 4 months ago
parent
commit
a2950c9ddb
1 changed files with 15 additions and 6 deletions
  1. +15
    -6
      gandi_service.go

+ 15
- 6
gandi_service.go View File

@ -47,12 +47,21 @@ func (service *GandiService) UpdateFreeSubdomains(freeSubdomains map[string][]st
Items: []GandiDomainRecord{},
}
for subdomain, ips := range freeSubdomains {
requestBody.Items = append(requestBody.Items, GandiDomainRecord{
Name: subdomain,
Type: "A",
Values: ips,
TTL: 300,
})
requestBody.Items = append(
requestBody.Items,
GandiDomainRecord{
Name: subdomain,
Type: "A",
Values: ips,
TTL: 300,
},
GandiDomainRecord{
Name: fmt.Sprintf("*.%s", subdomain),
Type: "A",
Values: ips,
TTL: 300,
},
)
}
requestBodyBytes, err := json.Marshal(requestBody)


Loading…
Cancel
Save