Class: Netchk::DNSServerVerifier
- Inherits:
-
Object
- Object
- Netchk::DNSServerVerifier
- Defined in:
- lib/netchk/dns_server_verifier.rb
Instance Method Summary collapse
-
#initialize(**options) ⇒ DNSServerVerifier
constructor
A new instance of DNSServerVerifier.
- #verify ⇒ Object
Constructor Details
#initialize(**options) ⇒ DNSServerVerifier
Returns a new instance of DNSServerVerifier.
8 9 10 |
# File 'lib/netchk/dns_server_verifier.rb', line 8 def initialize(**) @resolve_conf = ['resolv.conf'] end |
Instance Method Details
#verify ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/netchk/dns_server_verifier.rb', line 12 def verify nameservers = self.nameservers if nameservers.empty? $stderr.puts 'No DNS server found. Verify your configuration.' else puts "Using DNS servers #{nameservers.map { |ns| ns.join('#') }.join(', ')}" nameservers.map do |ns| verify_nameserver(*ns) end end end |