diff --git a/lib/landrush/action/setup.rb b/lib/landrush/action/setup.rb index f2b70f2..85f0c28 100644 --- a/lib/landrush/action/setup.rb +++ b/lib/landrush/action/setup.rb @@ -69,11 +69,19 @@ def setup_static_dns unless Store.hosts.has?(hostname, dns_value) info "adding static entry: #{hostname} => #{dns_value}" Store.hosts.set hostname, dns_value - Store.hosts.set(IPAddr.new(dns_value).reverse, hostname) + unless static_dns_ip_address(dns_value).nil? + Store.hosts.set(IPAddr.new(dns_value).reverse, hostname) + end end end end + def static_dns_ip_address(dns_value) + return IPAddr.new(dns_value) + rescue StandardError + return nil + end + def record_machine_dns_entry ip_address = machine.config.landrush.host_ip_address || host_ip_address