opendns-dnsdb 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.rspec +4 -0
- data/Gemfile +8 -0
- data/LICENSE +20 -0
- data/README.md +64 -0
- data/Rakefile +6 -0
- data/THANKS +1 -0
- data/docs/Makefile +177 -0
- data/docs/_themes/LICENSE +45 -0
- data/docs/_themes/README.rst +25 -0
- data/docs/_themes/flask_theme_support.py +86 -0
- data/docs/_themes/kr/layout.html +32 -0
- data/docs/_themes/kr/relations.html +19 -0
- data/docs/_themes/kr/static/flasky.css_t +469 -0
- data/docs/_themes/kr/static/small_flask.css +70 -0
- data/docs/_themes/kr/theme.conf +7 -0
- data/docs/_themes/kr_small/layout.html +22 -0
- data/docs/_themes/kr_small/static/flasky.css_t +287 -0
- data/docs/_themes/kr_small/theme.conf +10 -0
- data/docs/conf.py +261 -0
- data/docs/index.rst +101 -0
- data/docs/make.bat +242 -0
- data/docs/operations/by_ip.rst +229 -0
- data/docs/operations/by_name.rst +256 -0
- data/docs/operations/label.rst +217 -0
- data/docs/operations/related.rst +127 -0
- data/docs/operations/traffic.rst +126 -0
- data/lib/opendns-dnsdb.rb +5 -0
- data/lib/opendns-dnsdb/dnsdb.rb +58 -0
- data/lib/opendns-dnsdb/dnsdb/by_ip.rb +69 -0
- data/lib/opendns-dnsdb/dnsdb/by_name.rb +93 -0
- data/lib/opendns-dnsdb/dnsdb/label.rb +105 -0
- data/lib/opendns-dnsdb/dnsdb/related.rb +92 -0
- data/lib/opendns-dnsdb/dnsdb/response.rb +41 -0
- data/lib/opendns-dnsdb/dnsdb/rrutils.rb +11 -0
- data/lib/opendns-dnsdb/dnsdb/siphash.rb +94 -0
- data/lib/opendns-dnsdb/dnsdb/traffic.rb +80 -0
- data/lib/opendns-dnsdb/version.rb +5 -0
- data/opendns-dnsdb.gemspec +20 -0
- data/spec/by_ip_spec.rb +54 -0
- data/spec/by_name_spec.rb +88 -0
- data/spec/label_spec.rb +88 -0
- data/spec/related_spec.rb +92 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/traffic_spec.rb +36 -0
- metadata +123 -0
data/docs/index.rst
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
=============================
|
2
|
+
OpenDNS Security Graph client
|
3
|
+
=============================
|
4
|
+
|
5
|
+
.. _installation:
|
6
|
+
|
7
|
+
Installation
|
8
|
+
============
|
9
|
+
|
10
|
+
.. code-block:: bash
|
11
|
+
|
12
|
+
$ bundle && rake install
|
13
|
+
|
14
|
+
Example
|
15
|
+
=======
|
16
|
+
|
17
|
+
.. code-block:: ruby
|
18
|
+
|
19
|
+
# Setup
|
20
|
+
db = OpenDNS::DNSDB.new(sslcert: 'client.p12', sslcertpasswd: 'opendns')
|
21
|
+
|
22
|
+
# A short list of known spam domains using a fast-flux infrastructure
|
23
|
+
spam_names = ['com-garciniac.net', 'bbc-global.co.uk', 'com-october.net']
|
24
|
+
|
25
|
+
# Retrieve all the IP addresses these morons have been using
|
26
|
+
ips = db.distinct_ips_by_name(spam_names)
|
27
|
+
|
28
|
+
# Discover new domains mapping to the IP addresses we just found
|
29
|
+
all_spam_names = db.distinct_names_by_ip(ips)
|
30
|
+
|
31
|
+
# Find all the name servers used by these new domains
|
32
|
+
all_spam_names_ns = db.distinct_nameservers_ips_by_name(all_spam_names)
|
33
|
+
|
34
|
+
# Find all the domains served by these name servers
|
35
|
+
maybe_more_spam = db.distinct_names_by_nameserver_ip(all_spam_names_ns)
|
36
|
+
|
37
|
+
# Return the subset of names not flagged as malware by OpenDNS yet
|
38
|
+
not_blocked_yet = db.not_suspicious_names(maybe_more_spam)
|
39
|
+
|
40
|
+
# Does this list of domains include domains used by malware?
|
41
|
+
is_malware = db.include_suspicious?(['wh4u6igxiglekn.su', 'excue.ru'])
|
42
|
+
|
43
|
+
# Specifically, is excue.ru suspicious?
|
44
|
+
is_suspicious = db.is_suspicious?('excue.ru')
|
45
|
+
|
46
|
+
# Find all .ru names frequently observed with wh4u6igxiglekn.su and excue.ru:
|
47
|
+
rel_ru = db.distinct_related_names(['wh4u6igxiglekn.su', 'excue.ru'],
|
48
|
+
max_names: 500,
|
49
|
+
max_depth: 4) { |n| n.end_with? '.ru.' }
|
50
|
+
|
51
|
+
# Get the number of daily requests for the past 10 days, for
|
52
|
+
# github.com and github.io:
|
53
|
+
traffic = db.daily_traffic_by_name(['www.github.com', 'www.github.io'],
|
54
|
+
days_back: 10)
|
55
|
+
|
56
|
+
# Cut the noise from this traffic - Days with less than 10 queries
|
57
|
+
traffic = db.high_pass_filter(traffic, cutoff: 10)
|
58
|
+
|
59
|
+
# Check if the traffic for github.io is suspiciously spiky:
|
60
|
+
traffic_is_suspicious =
|
61
|
+
db.relative_standard_deviation(traffic['www.github.io']) > 90
|
62
|
+
|
63
|
+
Parallel requests
|
64
|
+
=================
|
65
|
+
|
66
|
+
This client library transparently supports parallel requests.
|
67
|
+
|
68
|
+
Most operations can be given either a single name or single IP, as well
|
69
|
+
as a list of names or IPs. The library will transparently paralellize
|
70
|
+
operations in order for bulk queries to complete as fast as possible.
|
71
|
+
|
72
|
+
Bulk operations can be performed on arbitrary large sets of names or
|
73
|
+
IP addresses.
|
74
|
+
|
75
|
+
Setup
|
76
|
+
=====
|
77
|
+
|
78
|
+
.. code-block:: ruby
|
79
|
+
|
80
|
+
require 'opendns-dnsdb'
|
81
|
+
db = OpenDNS::DNSDB.new(sslcert: 'client.p12', sslcertpasswd: 'opendns')
|
82
|
+
|
83
|
+
Supported options:
|
84
|
+
|
85
|
+
* ``timeout``: timeout for each query, in seconds (default: 15 seconds)
|
86
|
+
* ``sslcert``: path to the SSL certificate
|
87
|
+
* ``sslcerttype``: SSL certificate type, defaults to ``p12``
|
88
|
+
* ``sslcertpasswd``: SSL certificate password
|
89
|
+
* ``maxconnects``: max number of parallel operations (default: 10)
|
90
|
+
|
91
|
+
Operations
|
92
|
+
==========
|
93
|
+
|
94
|
+
.. toctree::
|
95
|
+
:maxdepth: 1
|
96
|
+
|
97
|
+
operations/by_name
|
98
|
+
operations/by_ip
|
99
|
+
operations/label
|
100
|
+
operations/related
|
101
|
+
operations/traffic
|
data/docs/make.bat
ADDED
@@ -0,0 +1,242 @@
|
|
1
|
+
@ECHO OFF
|
2
|
+
|
3
|
+
REM Command file for Sphinx documentation
|
4
|
+
|
5
|
+
if "%SPHINXBUILD%" == "" (
|
6
|
+
set SPHINXBUILD=sphinx-build
|
7
|
+
)
|
8
|
+
set BUILDDIR=_build
|
9
|
+
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
10
|
+
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
11
|
+
if NOT "%PAPER%" == "" (
|
12
|
+
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
13
|
+
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
14
|
+
)
|
15
|
+
|
16
|
+
if "%1" == "" goto help
|
17
|
+
|
18
|
+
if "%1" == "help" (
|
19
|
+
:help
|
20
|
+
echo.Please use `make ^<target^>` where ^<target^> is one of
|
21
|
+
echo. html to make standalone HTML files
|
22
|
+
echo. dirhtml to make HTML files named index.html in directories
|
23
|
+
echo. singlehtml to make a single large HTML file
|
24
|
+
echo. pickle to make pickle files
|
25
|
+
echo. json to make JSON files
|
26
|
+
echo. htmlhelp to make HTML files and a HTML help project
|
27
|
+
echo. qthelp to make HTML files and a qthelp project
|
28
|
+
echo. devhelp to make HTML files and a Devhelp project
|
29
|
+
echo. epub to make an epub
|
30
|
+
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
31
|
+
echo. text to make text files
|
32
|
+
echo. man to make manual pages
|
33
|
+
echo. texinfo to make Texinfo files
|
34
|
+
echo. gettext to make PO message catalogs
|
35
|
+
echo. changes to make an overview over all changed/added/deprecated items
|
36
|
+
echo. xml to make Docutils-native XML files
|
37
|
+
echo. pseudoxml to make pseudoxml-XML files for display purposes
|
38
|
+
echo. linkcheck to check all external links for integrity
|
39
|
+
echo. doctest to run all doctests embedded in the documentation if enabled
|
40
|
+
goto end
|
41
|
+
)
|
42
|
+
|
43
|
+
if "%1" == "clean" (
|
44
|
+
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
45
|
+
del /q /s %BUILDDIR%\*
|
46
|
+
goto end
|
47
|
+
)
|
48
|
+
|
49
|
+
|
50
|
+
%SPHINXBUILD% 2> nul
|
51
|
+
if errorlevel 9009 (
|
52
|
+
echo.
|
53
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
54
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
55
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
56
|
+
echo.may add the Sphinx directory to PATH.
|
57
|
+
echo.
|
58
|
+
echo.If you don't have Sphinx installed, grab it from
|
59
|
+
echo.http://sphinx-doc.org/
|
60
|
+
exit /b 1
|
61
|
+
)
|
62
|
+
|
63
|
+
if "%1" == "html" (
|
64
|
+
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
65
|
+
if errorlevel 1 exit /b 1
|
66
|
+
echo.
|
67
|
+
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
68
|
+
goto end
|
69
|
+
)
|
70
|
+
|
71
|
+
if "%1" == "dirhtml" (
|
72
|
+
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
73
|
+
if errorlevel 1 exit /b 1
|
74
|
+
echo.
|
75
|
+
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
76
|
+
goto end
|
77
|
+
)
|
78
|
+
|
79
|
+
if "%1" == "singlehtml" (
|
80
|
+
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
81
|
+
if errorlevel 1 exit /b 1
|
82
|
+
echo.
|
83
|
+
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
84
|
+
goto end
|
85
|
+
)
|
86
|
+
|
87
|
+
if "%1" == "pickle" (
|
88
|
+
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
89
|
+
if errorlevel 1 exit /b 1
|
90
|
+
echo.
|
91
|
+
echo.Build finished; now you can process the pickle files.
|
92
|
+
goto end
|
93
|
+
)
|
94
|
+
|
95
|
+
if "%1" == "json" (
|
96
|
+
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
97
|
+
if errorlevel 1 exit /b 1
|
98
|
+
echo.
|
99
|
+
echo.Build finished; now you can process the JSON files.
|
100
|
+
goto end
|
101
|
+
)
|
102
|
+
|
103
|
+
if "%1" == "htmlhelp" (
|
104
|
+
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
105
|
+
if errorlevel 1 exit /b 1
|
106
|
+
echo.
|
107
|
+
echo.Build finished; now you can run HTML Help Workshop with the ^
|
108
|
+
.hhp project file in %BUILDDIR%/htmlhelp.
|
109
|
+
goto end
|
110
|
+
)
|
111
|
+
|
112
|
+
if "%1" == "qthelp" (
|
113
|
+
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
114
|
+
if errorlevel 1 exit /b 1
|
115
|
+
echo.
|
116
|
+
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
117
|
+
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
118
|
+
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\OpenDNSDNSDatabaseClientLibrary.qhcp
|
119
|
+
echo.To view the help file:
|
120
|
+
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\OpenDNSDNSDatabaseClientLibrary.ghc
|
121
|
+
goto end
|
122
|
+
)
|
123
|
+
|
124
|
+
if "%1" == "devhelp" (
|
125
|
+
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
126
|
+
if errorlevel 1 exit /b 1
|
127
|
+
echo.
|
128
|
+
echo.Build finished.
|
129
|
+
goto end
|
130
|
+
)
|
131
|
+
|
132
|
+
if "%1" == "epub" (
|
133
|
+
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
134
|
+
if errorlevel 1 exit /b 1
|
135
|
+
echo.
|
136
|
+
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
137
|
+
goto end
|
138
|
+
)
|
139
|
+
|
140
|
+
if "%1" == "latex" (
|
141
|
+
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
142
|
+
if errorlevel 1 exit /b 1
|
143
|
+
echo.
|
144
|
+
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
145
|
+
goto end
|
146
|
+
)
|
147
|
+
|
148
|
+
if "%1" == "latexpdf" (
|
149
|
+
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
150
|
+
cd %BUILDDIR%/latex
|
151
|
+
make all-pdf
|
152
|
+
cd %BUILDDIR%/..
|
153
|
+
echo.
|
154
|
+
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
155
|
+
goto end
|
156
|
+
)
|
157
|
+
|
158
|
+
if "%1" == "latexpdfja" (
|
159
|
+
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
160
|
+
cd %BUILDDIR%/latex
|
161
|
+
make all-pdf-ja
|
162
|
+
cd %BUILDDIR%/..
|
163
|
+
echo.
|
164
|
+
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
165
|
+
goto end
|
166
|
+
)
|
167
|
+
|
168
|
+
if "%1" == "text" (
|
169
|
+
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
170
|
+
if errorlevel 1 exit /b 1
|
171
|
+
echo.
|
172
|
+
echo.Build finished. The text files are in %BUILDDIR%/text.
|
173
|
+
goto end
|
174
|
+
)
|
175
|
+
|
176
|
+
if "%1" == "man" (
|
177
|
+
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
178
|
+
if errorlevel 1 exit /b 1
|
179
|
+
echo.
|
180
|
+
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
181
|
+
goto end
|
182
|
+
)
|
183
|
+
|
184
|
+
if "%1" == "texinfo" (
|
185
|
+
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
186
|
+
if errorlevel 1 exit /b 1
|
187
|
+
echo.
|
188
|
+
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
189
|
+
goto end
|
190
|
+
)
|
191
|
+
|
192
|
+
if "%1" == "gettext" (
|
193
|
+
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
194
|
+
if errorlevel 1 exit /b 1
|
195
|
+
echo.
|
196
|
+
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
197
|
+
goto end
|
198
|
+
)
|
199
|
+
|
200
|
+
if "%1" == "changes" (
|
201
|
+
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
202
|
+
if errorlevel 1 exit /b 1
|
203
|
+
echo.
|
204
|
+
echo.The overview file is in %BUILDDIR%/changes.
|
205
|
+
goto end
|
206
|
+
)
|
207
|
+
|
208
|
+
if "%1" == "linkcheck" (
|
209
|
+
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
210
|
+
if errorlevel 1 exit /b 1
|
211
|
+
echo.
|
212
|
+
echo.Link check complete; look for any errors in the above output ^
|
213
|
+
or in %BUILDDIR%/linkcheck/output.txt.
|
214
|
+
goto end
|
215
|
+
)
|
216
|
+
|
217
|
+
if "%1" == "doctest" (
|
218
|
+
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
219
|
+
if errorlevel 1 exit /b 1
|
220
|
+
echo.
|
221
|
+
echo.Testing of doctests in the sources finished, look at the ^
|
222
|
+
results in %BUILDDIR%/doctest/output.txt.
|
223
|
+
goto end
|
224
|
+
)
|
225
|
+
|
226
|
+
if "%1" == "xml" (
|
227
|
+
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
|
228
|
+
if errorlevel 1 exit /b 1
|
229
|
+
echo.
|
230
|
+
echo.Build finished. The XML files are in %BUILDDIR%/xml.
|
231
|
+
goto end
|
232
|
+
)
|
233
|
+
|
234
|
+
if "%1" == "pseudoxml" (
|
235
|
+
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
|
236
|
+
if errorlevel 1 exit /b 1
|
237
|
+
echo.
|
238
|
+
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
|
239
|
+
goto end
|
240
|
+
)
|
241
|
+
|
242
|
+
:end
|
@@ -0,0 +1,229 @@
|
|
1
|
+
Getting information out of an IP address
|
2
|
+
========================================
|
3
|
+
|
4
|
+
Getting the list of names served by a name server
|
5
|
+
-------------------------------------------------
|
6
|
+
|
7
|
+
| This returns the list of names that have been served by an
|
8
|
+
| authoritative name server:
|
9
|
+
|
10
|
+
.. code-block:: ruby
|
11
|
+
|
12
|
+
db.names_by_nameserver_ip('199.185.137.3')
|
13
|
+
|
14
|
+
Returns a ``Response::Distinct``:
|
15
|
+
|
16
|
+
::
|
17
|
+
|
18
|
+
[
|
19
|
+
[ 0] "openbsd.com.",
|
20
|
+
[ 1] "openssh.com.",
|
21
|
+
[ 2] "yycix.ca.",
|
22
|
+
[ 3] "caisnet.com.",
|
23
|
+
[ 4] "cdnpowerpac.com.",
|
24
|
+
[ 5] "miarch.com.",
|
25
|
+
[ 6] "openbsd.org.",
|
26
|
+
[ 7] "theos.com.",
|
27
|
+
[ 8] "enhanced-business.com.",
|
28
|
+
[ 9] "onpa.ca.",
|
29
|
+
[10] "openbsdfoundation.org.",
|
30
|
+
[11] "eton-west.com.",
|
31
|
+
[12] "barr-ryder.com.",
|
32
|
+
[13] "chemco-elec.com.",
|
33
|
+
[14] "rakeng.com.",
|
34
|
+
[15] "yycix.com.",
|
35
|
+
[16] "elementsustainable.com.",
|
36
|
+
[17] "hartwigarchitecture.com.",
|
37
|
+
[18] "pentagonstructures.com.",
|
38
|
+
[19] "freezemaxwell.com.",
|
39
|
+
[20] "workungarrick.com.",
|
40
|
+
[21] "alpineheating.com.",
|
41
|
+
[22] "caisnet.ca.",
|
42
|
+
[23] "watertech.ca.",
|
43
|
+
[24] "desco.cc.",
|
44
|
+
[25] "openbsd.net.",
|
45
|
+
[26] "krawford.com.",
|
46
|
+
[27] "protostatix.com.",
|
47
|
+
[28] "rms-group.ca.",
|
48
|
+
[29] "cmroofing.ca.",
|
49
|
+
[30] "hoeng.com.",
|
50
|
+
[31] "openssh.net.",
|
51
|
+
[32] "cuthbertsmith.com.",
|
52
|
+
[33] "alta-tech.ca.",
|
53
|
+
[34] "bockroofing.com."
|
54
|
+
]
|
55
|
+
|
56
|
+
Getting the list of names that a set of name servers have been serving
|
57
|
+
----------------------------------------------------------------------
|
58
|
+
|
59
|
+
| This returns the list of names that have been served by a set of name
|
60
|
+
| servers:
|
61
|
+
|
62
|
+
.. code-block:: ruby
|
63
|
+
|
64
|
+
db.names_by_nameserver_ip(['199.185.137.3', '65.19.167.109'])
|
65
|
+
|
66
|
+
Returns a ``Response::HashByIP``:
|
67
|
+
|
68
|
+
::
|
69
|
+
|
70
|
+
{
|
71
|
+
"199.185.137.3" => [
|
72
|
+
[ 0] "openbsd.com.",
|
73
|
+
[ 1] "openssh.com.",
|
74
|
+
[ 2] "yycix.ca.",
|
75
|
+
[ 3] "caisnet.com.",
|
76
|
+
[ 4] "cdnpowerpac.com.",
|
77
|
+
[ 5] "miarch.com.",
|
78
|
+
[ 6] "openbsd.org.",
|
79
|
+
[ 7] "theos.com.",
|
80
|
+
[ 8] "enhanced-business.com.",
|
81
|
+
[ 9] "onpa.ca.",
|
82
|
+
[10] "openbsdfoundation.org.",
|
83
|
+
[11] "eton-west.com.",
|
84
|
+
[12] "barr-ryder.com.",
|
85
|
+
[13] "chemco-elec.com.",
|
86
|
+
[14] "rakeng.com.",
|
87
|
+
[15] "yycix.com.",
|
88
|
+
[16] "elementsustainable.com.",
|
89
|
+
[17] "hartwigarchitecture.com.",
|
90
|
+
[18] "pentagonstructures.com.",
|
91
|
+
[19] "freezemaxwell.com.",
|
92
|
+
[20] "workungarrick.com.",
|
93
|
+
[21] "alpineheating.com.",
|
94
|
+
[22] "caisnet.ca.",
|
95
|
+
[23] "watertech.ca.",
|
96
|
+
[24] "desco.cc.",
|
97
|
+
[25] "openbsd.net.",
|
98
|
+
[26] "krawford.com.",
|
99
|
+
[27] "protostatix.com.",
|
100
|
+
[28] "rms-group.ca.",
|
101
|
+
[29] "cmroofing.ca.",
|
102
|
+
[30] "hoeng.com.",
|
103
|
+
[31] "openssh.net.",
|
104
|
+
[32] "cuthbertsmith.com.",
|
105
|
+
[33] "alta-tech.ca.",
|
106
|
+
[34] "bockroofing.com."
|
107
|
+
],
|
108
|
+
"65.19.167.109" => [
|
109
|
+
[0] "backplane.com.",
|
110
|
+
[1] "dragonflybsd.org."
|
111
|
+
]
|
112
|
+
}
|
113
|
+
|
114
|
+
Getting the list of unique names served by a set of name servers
|
115
|
+
----------------------------------------------------------------
|
116
|
+
|
117
|
+
This returns a ``Response::Distinct`` of unique names served by a set of name
|
118
|
+
servers:
|
119
|
+
|
120
|
+
.. code-block:: ruby
|
121
|
+
|
122
|
+
db.distinct_names_by_nameserver_ip(['199.185.137.3', '65.19.167.109'])
|
123
|
+
|
124
|
+
Returns a ``Response::Distinct``:
|
125
|
+
|
126
|
+
::
|
127
|
+
|
128
|
+
[
|
129
|
+
[ 0] "openbsd.com.",
|
130
|
+
[ 1] "openssh.com.",
|
131
|
+
[ 2] "yycix.ca.",
|
132
|
+
[ 3] "caisnet.com.",
|
133
|
+
[ 4] "cdnpowerpac.com.",
|
134
|
+
[ 5] "miarch.com.",
|
135
|
+
[ 6] "openbsd.org.",
|
136
|
+
[ 7] "theos.com.",
|
137
|
+
[ 8] "enhanced-business.com.",
|
138
|
+
[ 9] "onpa.ca.",
|
139
|
+
[10] "openbsdfoundation.org.",
|
140
|
+
[11] "eton-west.com.",
|
141
|
+
[12] "barr-ryder.com.",
|
142
|
+
[13] "chemco-elec.com.",
|
143
|
+
[14] "rakeng.com.",
|
144
|
+
[15] "yycix.com.",
|
145
|
+
[16] "elementsustainable.com.",
|
146
|
+
[17] "hartwigarchitecture.com.",
|
147
|
+
[18] "pentagonstructures.com.",
|
148
|
+
[19] "freezemaxwell.com.",
|
149
|
+
[20] "workungarrick.com.",
|
150
|
+
[21] "alpineheating.com.",
|
151
|
+
[22] "caisnet.ca.",
|
152
|
+
[23] "watertech.ca.",
|
153
|
+
[24] "desco.cc.",
|
154
|
+
[25] "openbsd.net.",
|
155
|
+
[26] "krawford.com.",
|
156
|
+
[27] "protostatix.com.",
|
157
|
+
[28] "rms-group.ca.",
|
158
|
+
[29] "cmroofing.ca.",
|
159
|
+
[30] "hoeng.com.",
|
160
|
+
[31] "openssh.net.",
|
161
|
+
[32] "cuthbertsmith.com.",
|
162
|
+
[33] "alta-tech.ca.",
|
163
|
+
[34] "bockroofing.com.",
|
164
|
+
[35] "backplane.com.",
|
165
|
+
[36] "dragonflybsd.org."
|
166
|
+
]
|
167
|
+
|
168
|
+
Getting the list of all names that resolved to an IP
|
169
|
+
----------------------------------------------------
|
170
|
+
|
171
|
+
| This returns all the names that have been seen for an IP over the past
|
172
|
+
| 3 months:
|
173
|
+
|
174
|
+
.. code-block:: ruby
|
175
|
+
|
176
|
+
db.names_by_ip('192.30.252.131')
|
177
|
+
|
178
|
+
Returns a ``Response::Distinct``:
|
179
|
+
|
180
|
+
::
|
181
|
+
|
182
|
+
[
|
183
|
+
[0] "github.com.",
|
184
|
+
[1] "ip1d-lb3-prd.iad.github.com."
|
185
|
+
]
|
186
|
+
|
187
|
+
Getting the list of all names that resolved to a set of IPs
|
188
|
+
-----------------------------------------------------------
|
189
|
+
|
190
|
+
| A bulk operation to retrieve the list of names having mapped to a set
|
191
|
+
| of IPs:
|
192
|
+
|
193
|
+
.. code-block:: ruby
|
194
|
+
|
195
|
+
db.names_by_ip(['192.30.252.131', '199.233.90.68'])
|
196
|
+
|
197
|
+
Returns a ``Response::HashByIP``:
|
198
|
+
|
199
|
+
::
|
200
|
+
|
201
|
+
{
|
202
|
+
"192.30.252.131" => [
|
203
|
+
[0] "github.com.",
|
204
|
+
[1] "ip1d-lb3-prd.iad.github.com."
|
205
|
+
],
|
206
|
+
"199.233.90.68" => [
|
207
|
+
[0] "leaf.dragonflybsd.org."
|
208
|
+
]
|
209
|
+
}
|
210
|
+
|
211
|
+
Getting the list of unique names for a set of IPs
|
212
|
+
-------------------------------------------------
|
213
|
+
|
214
|
+
| This method returns a list of distinct names seen for a set of IP
|
215
|
+
| addresses:
|
216
|
+
|
217
|
+
.. code-block:: ruby
|
218
|
+
|
219
|
+
db.distinct_names_by_ip(['192.30.252.131', '199.233.90.68'])
|
220
|
+
|
221
|
+
Returns a ``Response::Distinct``:
|
222
|
+
|
223
|
+
::
|
224
|
+
|
225
|
+
[
|
226
|
+
[0] "github.com.",
|
227
|
+
[1] "ip1d-lb3-prd.iad.github.com.",
|
228
|
+
[2] "leaf.dragonflybsd.org."
|
229
|
+
]
|