vagrant-dns 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.2.4
2
+
3
+ * Enable passthrough in DNS service. Helpful if you insist to hook a standard tld like .io.
4
+
1
5
  # v0.2.3
2
6
 
3
7
  * Remove unneeded iteraton in installers/mac.rb. (thanks to JonathanTron for reporting)
@@ -19,9 +19,22 @@ module VagrantDNS
19
19
 
20
20
  def run!(run_options)
21
21
  Daemons.run_proc("vagrant-dns", run_options) do
22
+ require 'resolv'
22
23
  require 'rubydns'
23
24
 
25
+ # come on, this is Ruby
26
+ # Ruby 1.9.3 does not implement :make_requester anymore
27
+ # Luckily :make_udp_requester is just the same
28
+ begin
29
+ Resolv::DNS.instance_method(:make_requester)
30
+ rescue NameError
31
+ Resolv::DNS.class_eval {
32
+ alias :make_requester :make_udp_requester
33
+ }
34
+ end
35
+
24
36
  registry = YAML.load(File.read(config_file))
37
+ std_resolver = Resolv::DNS.new
25
38
 
26
39
  RubyDNS::run_server(:listen => VagrantDNS::Config.listen) do
27
40
  registry.each do |pattern, ip|
@@ -29,6 +42,13 @@ module VagrantDNS
29
42
  transaction.respond!(ip)
30
43
  end
31
44
  end
45
+
46
+ otherwise do |transaction|
47
+ transaction.passthrough!(std_resolver) do |reply, reply_name|
48
+ puts reply
49
+ puts reply_name
50
+ end
51
+ end
32
52
  end
33
53
  end
34
54
  end
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Dns
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-dns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-13 00:00:00.000000000 Z
12
+ date: 2012-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vagrant