code: func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
  	if config == nil {
  		return nil, errors.New("rfc2136: the configuration of the DNS provider is nil")
  	}
  
  	if config.Nameserver == "" {
  		return nil, fmt.Errorf("rfc2136: nameserver missing")
  	}
  
  	if config.TSIGAlgorithm == "" {
  		config.TSIGAlgorithm = dns.HmacMD5
  	}
  
  	// Append the default DNS port if none is specified.
  	if _, _, err := net.SplitHostPort(config.Nameserver); err != nil {
  		if strings.Contains(err.Error(), "missing port") {
  			config.Nameserver = net.JoinHostPort(config.Nameserver, "53")
  		} else {
  			return nil, fmt.Errorf("rfc2136: %v", err)
  		}
  	}
  
  	if len(config.TSIGKey) == 0 && len(config.TSIGSecret) > 0 ||
  		len(config.TSIGKey) > 0 && len(config.TSIGSecret) == 0 {
  		config.TSIGKey = ""
  		config.TSIGSecret = ""
  	}
  
  	return &DNSProvider{config: config}, nil
  }
docs: // NewDNSProviderConfig return a DNSProvider instance configured for rfc2136.