private static void UpdateHostnames(string ipAddress, bool forceUpdate)
{
string hostnamesToUpdate = ConfigurationManager.AppSettings["HostNamesToUpdate"];
var updater = new BespokeUpdater(Config.DynamicDnsUpdaterClientTypeId);
//We can force the update if we don't initialize the last ip address that was used.
//this is useful because of DNS Caching
if(!forceUpdate)
{
updater.Client.InitializeLastUpdateIpAddresses(hostnamesToUpdate);
}
if(!string.IsNullOrWhiteSpace(ipAddress))
{
updater.Client.UpdateHostnames(hostnamesToUpdate, ipAddress);
}
else
{
updater.Client.UpdateHostnames(hostnamesToUpdate);
}
//Console.ReadLine();
}