// CheckDomain checks the IP address assigned to the domain and its subdomains,
// compares it to the real IP address of the server and
// orders to change the DNS record if needed.
CheckDomain checks the IP address assigned to the domain and its subdomains,
compares it to the real IP address of the server and
orders to change the DNS record if needed.
// CheckDomain checks the IP address assigned to the domain and its subdomains // compares it to the real IP address of the server and // orders to change the DNS record if needed .
func CheckDomain(config *DomainConfig, token string) {
	externalIP, err := GetExternalIP()
	if err != nil {
		os.Stderr.WriteString(err.Error() + "\n")
		return
	}
	os.Stdout.WriteString("External IP: " + externalIP + "\n")
	domainRecords, err := GetDomainRecords(config.Domain, token)
	if err != nil {
		os.Stderr.WriteString(err.Error() + "\n")
		return
	}
	for _, record := range domainRecords {
		CheckRecord(config, record, "@", externalIP, token)
		for _, subdomain := range config.Subdomains {
			CheckRecord(config, record, subdomain, externalIP, token)
		}
	}
}
func CheckDomain ( config * DomainConfig , token string ) { externalIP , err := GetExternalIP ( ) if err != nil { os . Stderr . WriteString ( err . Error ( ) + " \n " ) return } os . Stdout . WriteString ( " " + externalIP + " \n " ) domainRecords , err := GetDomainRecords ( config . Domain , token ) if err != nil { os . Stderr . WriteString ( err . Error ( ) + " \n " ) return } for _ , record := range domainRecords { CheckRecord ( config , record , " " , externalIP , token ) for _ , subdomain := range config . Subdomains { CheckRecord ( config , record , subdomain , externalIP , token ) } } }
CheckDomain checks the IP address assigned to the domain and its subdomains,
compares it to the real IP address of the server and
orders to change the DNS record if needed.
CheckDomain checks the IP address assigned to the domain and its subdomains compares it to the real IP address of the server and orders to change the DNS record if needed .