Commit 2f1b5a2c authored by Felix Yan's avatar Felix Yan

verify: consider both Glue and A records from Authoritative DNS

It's a common practice that they don't match. Let's assume the domestic
recursive DNS servers will pick the best one so we consider both.
parent 5c6e3b20
......@@ -39,13 +39,10 @@ class ChinaListVerify
raise "chnroutes not loaded"
end
answers = nil
if response != nil && !response.empty?
answers = response.filter_map { |n, r| r if n.to_s == domain && r.class == Resolv::DNS::Resource::IN::A }
end
answers = resolve(domain, 'A')
if answers == nil || answers.empty?
answers = resolve(domain, 'A')
if response != nil && !response.empty?
answers += response.filter_map { |n, r| r if n.to_s == domain && r.class == Resolv::DNS::Resource::IN::A }
end
answers.each do |answer|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment