Added "no_dns_lookup" json parameter

This commit is contained in:
Quentin McGaw
2019-05-04 00:42:45 +02:00
parent 01c671d380
commit fa382bc74c
4 changed files with 12 additions and 5 deletions

View File

@@ -8,11 +8,12 @@ import (
// SettingsType contains the elements to update the DNS record
type SettingsType struct {
Domain string
Host string
Provider ProviderType
IPmethod IPMethodType
Delay time.Duration
Domain string
Host string
Provider ProviderType
IPmethod IPMethodType
Delay time.Duration
NoDNSLookup bool
// Provider dependent fields
Password string // Namecheap only
Key string // GoDaddy, Dreamhost and Cloudflare only

View File

@@ -19,6 +19,7 @@ type settingsType struct {
Domain string `json:"domain"`
IPMethod string `json:"ip_method"`
Delay int `json:"delay"`
NoDNSLookup bool `json:"no_dns_lookup"`
Host string `json:"host"`
Password string `json:"password"` // Namecheap only
Key string `json:"key"` // GoDaddy, Dreamhost and Cloudflare only
@@ -67,6 +68,7 @@ func getSettingsJSON(filePath string) (settings []models.SettingsType, warnings
Host: host,
IPmethod: IPMethod,
Delay: delay,
NoDNSLookup: s.NoDNSLookup,
Password: s.Password,
Key: s.Key,
Secret: s.Secret,

View File

@@ -13,6 +13,9 @@ func healthcheckHandler(recordsConfigs []models.RecordConfigType) error {
if recordsConfigs[i].Status.Code == models.FAIL {
return fmt.Errorf("%s", recordsConfigs[i].String())
}
if recordsConfigs[i].Settings.NoDNSLookup {
continue
}
ips, err := net.LookupIP(recordsConfigs[i].Settings.BuildDomainName())
if err != nil {
return err