mirror of
https://github.com/internetee/registry.git
synced 2025-06-14 16:44:46 +02:00
changed conditions for glue records
This commit is contained in:
parent
ded6715309
commit
37a80faf14
2 changed files with 9 additions and 4 deletions
|
@ -90,6 +90,8 @@ class NameserverRecordValidationJob < ApplicationJob
|
||||||
text = "Something went wrong, exception reason: **#{result[:error_info]}**"
|
text = "Something went wrong, exception reason: **#{result[:error_info]}**"
|
||||||
when 'domain'
|
when 'domain'
|
||||||
text = "#{domain} zone is not in nameserver**#{nameserver.hostname}**"
|
text = "#{domain} zone is not in nameserver**#{nameserver.hostname}**"
|
||||||
|
when 'glup record'
|
||||||
|
text = "Hostname #{nameserver.hostname} didn't resovle by glue record to #{domain}"
|
||||||
end
|
end
|
||||||
|
|
||||||
logger.info text
|
logger.info text
|
||||||
|
|
|
@ -14,11 +14,13 @@ module NameserverValidator
|
||||||
if result_response[:error_info].to_s.include? "Nameserver invalid!"
|
if result_response[:error_info].to_s.include? "Nameserver invalid!"
|
||||||
if nameserver.ipv4.present?
|
if nameserver.ipv4.present?
|
||||||
result_response = validate(domain_name: domain_name, hostname: nameserver.ipv4)
|
result_response = validate(domain_name: domain_name, hostname: nameserver.ipv4)
|
||||||
elsif nameserver.ipv6.present?
|
# elsif nameserver.ipv6.present?
|
||||||
result_response = validate(domain_name: domain_name, hostname: nameserver.ipv6)
|
# result_response = validate(domain_name: domain_name, hostname: nameserver.ipv6)
|
||||||
end
|
end
|
||||||
|
|
||||||
result_response
|
return { result: false, reason: 'glup record' } if result.answer.empty? if result_response[:result]
|
||||||
|
|
||||||
|
return result_response
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -58,7 +60,8 @@ module NameserverValidator
|
||||||
|
|
||||||
def setup_resolver(hostname)
|
def setup_resolver(hostname)
|
||||||
resolver = Dnsruby::Resolver.new
|
resolver = Dnsruby::Resolver.new
|
||||||
resolver.query_timeout = ENV['nameserver_validation_timeout'].to_i || 5
|
timeouts = ENV['nameserver_validation_timeout'] || 4
|
||||||
|
resolver.query_timeout = timeouts.to_i
|
||||||
resolver.retry_times = 3
|
resolver.retry_times = 3
|
||||||
resolver.recurse = 0 # Send out non-recursive queries
|
resolver.recurse = 0 # Send out non-recursive queries
|
||||||
# disable caching otherwise SOA is cached from first nameserver queried
|
# disable caching otherwise SOA is cached from first nameserver queried
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue