mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-04-05 08:54:09 -04:00
Added "no_dns_lookup" json parameter
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user