Class: Resolv

Inherits:
Object show all
Defined in:
lib/ronin/extensions/resolv.rb

Constant Summary collapse

TLDS =

List of valid Top-Level-Domains

%w[
aero arpa asia biz cat com coop edu gov info int jobs mil mobi museum net
org pro tel travel xxx

ac ad ae af ag ai al am an ao aq ar as at au aw ax az
ba bb bd be bf bg bh bi bj bm bn bo br bs bt bv bw by bz
ca cc cd cf cg ch ci ck cl cm cn co cr cs cu cv cx cy cz
dd de dj dk dm do dz
ec ee eg eh er es et eu
fi fj fk fm fo fr
ga gb gd ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy
hk hm hn hr ht hu
id ie il im in io iq ir is it
je jm jo jp
ke kg kh ki km kn kp kr kw ky kz
la lb lc li lk lr ls lt lu lv ly
ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu mv mw mx my mz
na nc ne nf ng ni nl no np nr nu nz
om
pa pe pf pg ph pk pl pm pn pr ps pt pw py
qa
re ro rs ru rw
sa sb sc sd se sg sh si sj sk sl sm sn so sr ss st su sv sy sz
tc td tf tg th tj tk tl tm tn to tp tr tt tv tw tz
ua ug ak us uy uz
va vc ve vg vi vn vu
wf ws
ye yt
za zm zw

Class Method Summary collapse

Class Method Details

.resolver(nameserver = nil) ⇒ Resolv::DNS

Creates a new resolver.

Examples:

Resolv.resolver('4.2.2.1')

Parameters:

  • nameserver (String, Array<String>, nil) (defaults to: nil)

    The nameserver(s) to query.

Returns:

  • (Resolv::DNS)

    A new resolver for the given nameservers, or the default resolver.

Since:

  • 0.3.0


72
73
74
75
76
# File 'lib/ronin/extensions/resolv.rb', line 72

def Resolv.resolver(nameserver=nil)
  if nameserver then DNS.new(:nameserver => nameserver)
  else               self
  end
end