Class | Dnsruby::DNS |
In: |
lib/Dnsruby/DNS.rb
|
Parent: | Object |
Resolv::DNS performs DNS queries.
((|config_info|)) should be nil, a string or a hash. If nil is given, /etc/resolv.conf and platform specific information is used. If a string is given, it should be a filename which format is same as /etc/resolv.conf. If a hash is given, it may contains information for nameserver, search and ndots as follows. Dnsruby::DNS.new({:nameserver=>["210.251.121.21"], :search=>["ruby-lang.org"], :ndots=>1})
address lookup methods. ((|name|)) must be an instance of Dnsruby::Name or String. Resultant address is represented as an instance of Dnsruby::IPv4 or Dnsruby::IPv6.
These methods lookup hostnames . ((|address|)) must be an instance of Dnsruby::IPv4, Dnsruby::IPv6 or String. Resultant name is represented as an instance of Dnsruby::Name.
These methods lookup DNS resources of ((|name|)). ((|name|)) must be a instance of Dnsruby::Name or String. ((|type|)) must be a member of Dnsruby::Types ((|class|)) must be a member of Dnsruby::Classes Resultant resource is represented as an instance of (a subclass of) Dnsruby::RR. (Dnsruby::RR::IN::A, etc.)
The searchlist and other Config info is applied to the domain name if appropriate. All the nameservers are tried (if there is no timely answer from the first).
This class uses Resolver to perform the queries.
Information taken from the following places :
config | [R] |
config_info can be:
example : Dnsruby::DNS.new({:nameserver => ['210.251.121.21'], :search => ['ruby-lang.org'], :ndots => 1})
Creates a new DNS resolver. See Resolv::DNS.new for argument details.
Yields the created DNS resolver to the block, if given, otherwise returns it.
Iterates over all IP addresses of name retrieved from the DNS resolver
name can be a Dnsruby::Name or a String. Retrieved address will be a Dnsruby::IPv4 or a Dnsruby::IPv6
Iterates over all hostnames for address retrieved from the DNS resolver
address must be a Dnsruby::IPv4, Dnsruby::IPv6 or a String. Retrieved name will be a Dnsruby::Name.
Iterates over all type, klass resources for name
type defaults to Dnsruby::Types.A klass defaults to Dnsruby::Classes.IN
Yielded resource is represented as a Dnsruby::RR instance, e.g. Dnsruby::RR::IN::A
Gets the first IP address of name from the DNS resolver
name can be a Dnsruby::Name or a String. Retrieved address will be a Dnsruby::IPv4 or a Dnsruby::IPv6
Gets all IP addresses of name from the DNS resolver
name can be a Dnsruby::Name or a String. Retrieved address will be a Dnsruby::IPv4 or a Dnsruby::IPv6
Gets the first hostname for address from the DNS resolver
address must be a Dnsruby::IPv4, Dnsruby::IPv6 or a String. Retrieved name will be a Dnsruby::Name.
Gets all hostnames for address from the DNS resolver
address must be a Dnsruby::IPv4, Dnsruby::IPv6 or a String. Retrieved name will be a Dnsruby::Name.
Look up the first type, klass resource for name
type defaults to Dnsruby::Types.A klass defaults to Dnsruby::Classes.IN
Returned resource is represented as a Dnsruby::RR instance, e.g. Dnsruby::RR::IN::A
Look up all type, klass resources for name
type defaults to Dnsruby::Types.A klass defaults to Dnsruby::Classes.IN
Returned resource is represented as a Dnsruby::RR instance, e.g. Dnsruby::RR::IN::A