rubydns 2.0.0.pre.rc2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/examples/basic-dns.rb +1 -1
- data/examples/cname.rb +1 -1
- data/examples/flakey-dns.rb +1 -1
- data/examples/geoip-dns.rb +1 -1
- data/examples/simple.rb +1 -1
- data/examples/soa-dns.rb +1 -1
- data/examples/test-dns-1.rb +1 -1
- data/examples/test-dns-2.rb +1 -1
- data/lib/rubydns.rb +7 -2
- data/lib/rubydns/rule_based_server.rb +2 -2
- data/lib/rubydns/version.rb +1 -1
- data/rubydns.gemspec +1 -1
- data/spec/rubydns/daemon_spec.rb +1 -1
- data/spec/rubydns/injected_supervisor_spec.rb +1 -1
- data/spec/rubydns/passthrough_spec.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bac5139eae169f981088495e6dc4bde5d13fa966
|
4
|
+
data.tar.gz: 0ee8216c43d6600fb811ee83d708ac984d2807df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caa862959c454afebceddbf387e5722ff6a013a6c1c6012f5cb5acf1ec4d6c9422ea1c641fb3b776ecd270ec9278640e6b7088b64cbcea9ce8e8783c579f45a1
|
7
|
+
data.tar.gz: 136467f2543e9eb1ae01b158cca987ec1757d01bd2aa10c695249a204a68a8e88137b39cc907f4bf9cc544c9046a94848542fddde3578f6bf553459e1c81c9bf
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ IN = Resolv::DNS::Resource::IN
|
|
47
47
|
UPSTREAM = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
|
48
48
|
|
49
49
|
# Start the RubyDNS server
|
50
|
-
RubyDNS::run_server(
|
50
|
+
RubyDNS::run_server(INTERFACES) do
|
51
51
|
match(%r{test.local}, IN::A) do |transaction|
|
52
52
|
transaction.respond!("10.0.0.80")
|
53
53
|
end
|
@@ -68,7 +68,7 @@ Start the server using `RUBYOPT=-w ./examples/basic-dns.rb`. You can then test i
|
|
68
68
|
|
69
69
|
On some platforms (e.g. Mac OS X) the number of file descriptors is relatively low by default and should be increased by calling `ulimit -n 10000` before running tests or even before starting a server which expects a large number of concurrent incoming connections.
|
70
70
|
|
71
|
-
### Custom
|
71
|
+
### Custom Servers
|
72
72
|
|
73
73
|
It is possible to create and integrate your own custom servers, however this functionality has now moved to [`Async::DNS::Server`](https://github.com/socketry/async-dns).
|
74
74
|
|
@@ -135,11 +135,19 @@ DNSSEC is currently not supported and is [unlikely to be supported in the future
|
|
135
135
|
* Support reverse records more easily.
|
136
136
|
* Some kind of system level integration, e.g. registering a DNS server with the currently running system resolver.
|
137
137
|
|
138
|
+
## See Also
|
139
|
+
|
140
|
+
The majority of this gem is now implemented by `async-dns`.
|
141
|
+
|
142
|
+
- [async-io](https://github.com/socketry/async-io) — Asynchronous networking and sockets.
|
143
|
+
- [async-dns](https://github.com/socketry/async-dns) — Asynchronous DNS resolver and server.
|
144
|
+
- [async-rspec](https://github.com/socketry/async-rspec) — Shared contexts for running async specs.
|
145
|
+
|
138
146
|
## License
|
139
147
|
|
140
148
|
Released under the MIT license.
|
141
149
|
|
142
|
-
Copyright,
|
150
|
+
Copyright, 2017, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
|
143
151
|
|
144
152
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
145
153
|
of this software and associated documentation files (the "Software"), to deal
|
data/examples/basic-dns.rb
CHANGED
@@ -12,7 +12,7 @@ IN = Resolv::DNS::Resource::IN
|
|
12
12
|
UPSTREAM = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
|
13
13
|
|
14
14
|
# Start the RubyDNS server
|
15
|
-
RubyDNS::run_server(
|
15
|
+
RubyDNS::run_server(INTERFACES) do
|
16
16
|
match(%r{test.local}, IN::A) do |transaction|
|
17
17
|
transaction.respond!("10.0.0.80")
|
18
18
|
end
|
data/examples/cname.rb
CHANGED
@@ -13,7 +13,7 @@ IN = Resolv::DNS::Resource::IN
|
|
13
13
|
|
14
14
|
UPSTREAM = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
|
15
15
|
|
16
|
-
RubyDNS::run_server(
|
16
|
+
RubyDNS::run_server(INTERFACES) do
|
17
17
|
# How to respond to something other than what was requested.
|
18
18
|
match(//, IN::A) do |transaction|
|
19
19
|
transaction.respond!(Name.create('foo.bar'), resource_class: IN::CNAME)
|
data/examples/flakey-dns.rb
CHANGED
@@ -38,7 +38,7 @@ class FlakeyDNS < Process::Daemon
|
|
38
38
|
IN = Resolv::DNS::Resource::IN
|
39
39
|
|
40
40
|
def startup
|
41
|
-
RubyDNS.run_server(
|
41
|
+
RubyDNS.run_server(INTERFACES) do
|
42
42
|
# Use a Celluloid supervisor so the system recovers if the actor dies
|
43
43
|
fallback_resolver_supervisor =
|
44
44
|
RubyDNS::Resolver.supervise(RubyDNS::System.nameservers)
|
data/examples/geoip-dns.rb
CHANGED
@@ -57,7 +57,7 @@ class GeoIPDNS < Process::Daemon
|
|
57
57
|
IN = Resolv::DNS::Resource::IN
|
58
58
|
|
59
59
|
def startup
|
60
|
-
RubyDNS.run_server(
|
60
|
+
RubyDNS.run_server(INTERFACES) do
|
61
61
|
fallback_resolver_supervisor = RubyDNS::Resolver.supervise(RubyDNS::System.nameservers)
|
62
62
|
|
63
63
|
match(//, IN::A) do |transaction|
|
data/examples/simple.rb
CHANGED
@@ -13,7 +13,7 @@ IN = Resolv::DNS::Resource::IN
|
|
13
13
|
UPSTREAM = RubyDNS::Resolver.new([[:udp, '8.8.8.8', 53], [:tcp, '8.8.8.8', 53]])
|
14
14
|
|
15
15
|
# Start the RubyDNS server
|
16
|
-
RubyDNS.run_server(
|
16
|
+
RubyDNS.run_server(INTERFACES) do
|
17
17
|
match(/test.mydomain.org/, IN::A) do |transaction|
|
18
18
|
transaction.respond!('10.0.0.80')
|
19
19
|
end
|
data/examples/soa-dns.rb
CHANGED
@@ -27,7 +27,7 @@ $R = Resolv::DNS.new
|
|
27
27
|
Name = Resolv::DNS::Name
|
28
28
|
IN = Resolv::DNS::Resource::IN
|
29
29
|
|
30
|
-
RubyDNS.run_server(
|
30
|
+
RubyDNS.run_server([[:udp, '0.0.0.0', 5400]]) do
|
31
31
|
# SOA Record
|
32
32
|
# dig @localhost -p 5400 SOA mydomain.org
|
33
33
|
match('mydomain.org', IN::SOA) do |transaction|
|
data/examples/test-dns-1.rb
CHANGED
@@ -37,7 +37,7 @@ INTERFACES = [
|
|
37
37
|
# [:tcp, '::0', 5300],
|
38
38
|
]
|
39
39
|
|
40
|
-
RubyDNS.run_server(
|
40
|
+
RubyDNS.run_server(INTERFACES) do
|
41
41
|
# % dig +nocmd +noall +answer @localhost ANY dev.mydomain.org
|
42
42
|
# dev.mydomain.org. 16000 IN A 10.0.0.80
|
43
43
|
# dev.mydomain.org. 16000 IN MX 10 mail.mydomain.org.
|
data/examples/test-dns-2.rb
CHANGED
data/lib/rubydns.rb
CHANGED
@@ -28,8 +28,13 @@ module RubyDNS
|
|
28
28
|
Resolver = Async::DNS::Resolver
|
29
29
|
|
30
30
|
# Run a server with the given rules.
|
31
|
-
def self.run_server (server_class: RuleBasedServer, **options, &block)
|
32
|
-
|
31
|
+
def self.run_server (*args, server_class: RuleBasedServer, **options, &block)
|
32
|
+
if listen = options.delete(:listen)
|
33
|
+
warn "Using `listen:` option is deprecated, please pass as the first argument."
|
34
|
+
args.unshift(listen)
|
35
|
+
end
|
36
|
+
|
37
|
+
server = server_class.new(*args, **options, &block)
|
33
38
|
|
34
39
|
server.run
|
35
40
|
end
|
data/lib/rubydns/version.rb
CHANGED
data/rubydns.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
|
31
31
|
spec.required_ruby_version = '>= 2.2.6'
|
32
32
|
|
33
|
-
spec.add_dependency("async-dns", "~> 0
|
33
|
+
spec.add_dependency("async-dns", "~> 1.0")
|
34
34
|
spec.add_development_dependency("async-rspec", "~> 1.0")
|
35
35
|
|
36
36
|
spec.add_development_dependency "bundler", "~> 1.3"
|
data/spec/rubydns/daemon_spec.rb
CHANGED
@@ -38,7 +38,7 @@ module RubyDNS::InjectedSupervisorSpec
|
|
38
38
|
|
39
39
|
let(:server) do
|
40
40
|
# Start the RubyDNS server
|
41
|
-
RubyDNS::run_server(
|
41
|
+
RubyDNS::run_server(SERVER_PORTS, server_class: TestServer) do
|
42
42
|
match("test_message", IN::TXT) do |transaction|
|
43
43
|
transaction.respond!(*test_message.chunked)
|
44
44
|
end
|
@@ -31,7 +31,7 @@ module RubyDNS::PassthroughSpec
|
|
31
31
|
include_context Async::RSpec::Reactor
|
32
32
|
|
33
33
|
def run_server
|
34
|
-
task = RubyDNS::run_server(:
|
34
|
+
task = RubyDNS::run_server(listen: SERVER_PORTS) do
|
35
35
|
resolver = RubyDNS::Resolver.new([[:udp, "8.8.8.8", 53], [:tcp, "8.8.8.8", 53]])
|
36
36
|
|
37
37
|
match(/.*\.com/, IN::A) do |transaction|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubydns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-dns
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: async-rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,9 +140,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: 2.2.6
|
141
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubyforge_project:
|
148
148
|
rubygems_version: 2.6.10
|