diff --git a/app/models/domain.rb b/app/models/domain.rb index 5959cbb90..3751da5b6 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -478,7 +478,8 @@ class Domain < ActiveRecord::Base def validate_nameserver_ips nameservers.to_a.reject(&:marked_for_destruction?).each do |ns| next unless ns.hostname.end_with?(".#{name}") - next if ns.ipv4.present? + next if ns.ipv4.present? || ns.ipv6.present? + errors.add(:nameservers, :invalid) if errors[:nameservers].blank? ns.errors.add(:ipv4, :blank) end diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb index 9ca1bebf7..86cd7e002 100644 --- a/app/models/nameserver.rb +++ b/app/models/nameserver.rb @@ -32,7 +32,7 @@ class Nameserver < ActiveRecord::Base [:ipv4, :invalid, { value: { obj: 'hostAddr', val: ipv4 } }], [:ipv6, :invalid, { value: { obj: 'hostAddr', val: ipv6 } }] ], - '2306' => [ + '2003' => [ [:ipv4, :blank] ] } diff --git a/config/locales/en.yml b/config/locales/en.yml index 400985d16..f2f4d061f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -136,7 +136,7 @@ en: taken: 'Nameserver already exists on this domain' puny_to_long: 'Hostname puny label is too long (maximum is 63 characters)' ipv4: - blank: 'IPv4 is missing' + blank: 'IP is missing' invalid: 'IPv4 is invalid' ipv6: invalid: 'IPv6 is invalid'