vagrant-dns 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -27,7 +27,7 @@ end
27
27
  VagrantDNS::Config.logger = Logger.new("dns.log")
28
28
  ```
29
29
 
30
- Then, register the DNS server as a resolver. RVM users must use `rvmsudo` instead of `sudo`:
30
+ Then, register the DNS server as a resolver:
31
31
 
32
32
  ```bash
33
33
  $ vagrant dns --install
@@ -57,11 +57,28 @@ $ vagrant dns --start
57
57
  And test it:
58
58
 
59
59
  ```bash
60
- $ dig @localhost -p 5300 test.machine.dev
60
+ $ scutil --dns
61
+ ...
62
+ resolver #8
63
+ domain : dev
64
+ nameserver[0] : 127.0.0.1
65
+ port : 5300
66
+ ...
67
+ $ dscacheutil -q host -a name test.machine.dev
68
+ name: test.machine.dev
69
+ ip_address: 33.33.33.10
61
70
  ```
62
71
 
63
72
  You can now reach the server under the given domain.
64
73
 
74
+ **Note:** Mac OS X is quite different from Linux regarding DNS resolution. As a result, do not use
75
+ `dig` or `nslookup`, but `dscacheutil` instead. Read [this article](http://apple.stackexchange.com/a/70583)
76
+ for more information.
77
+
78
+ **Note:** Chrome users could still encounter problems resolving hosts in the development subdomain(s).
79
+ If this is the case, make sure to turn of the [Built-in Asynchronous DNS](https://plus.google.com/100132233764003563318/posts/JXcvYw1yCkH)
80
+ client. The built-in DNS client not handling split DNS is [reported](https://code.google.com/p/chromium/issues/detail?id=265970).
81
+
65
82
  Finally, stop the server using:
66
83
 
67
84
  ```bash
@@ -1,6 +1,6 @@
1
1
  require 'optparse'
2
2
  require 'daemons'
3
- require 'rbconfig'
3
+ require 'vagrant'
4
4
 
5
5
  module VagrantDNS
6
6
 
@@ -68,7 +68,7 @@ module VagrantDNS
68
68
  protected
69
69
 
70
70
  def manage_installation(vms, options)
71
- if RbConfig::CONFIG["host_os"].match /darwin/
71
+ if Vagrant::Util::Platform.darwin?
72
72
  installer = VagrantDNS::Installers::Mac.new(tmp_path)
73
73
 
74
74
  if options[:install]
@@ -82,7 +82,7 @@ module VagrantDNS
82
82
  end
83
83
 
84
84
  def manage_service(vms, options)
85
- service = VagrantDNS::Service.new(tmp_path, options)
85
+ service = VagrantDNS::Service.new(tmp_path)
86
86
 
87
87
  if options[:start]
88
88
  service.start!
@@ -10,19 +10,22 @@ module VagrantDNS
10
10
  def install!
11
11
  require 'fileutils'
12
12
 
13
- `sudo mkdir -p #{install_path}`
13
+ command = "mkdir -p #{install_path}\n"
14
14
  registered_resolvers.each do |resolver|
15
- `sudo ln -sf #{resolver} #{install_path}`
15
+ command += "ln -sf #{resolver} #{install_path}\n"
16
16
  end
17
+ `osascript -e 'do shell script \"#{command}\" with administrator privileges'`
17
18
  end
18
19
 
19
20
  def uninstall!
20
21
  require 'fileutils'
21
22
 
23
+ command = ""
22
24
  registered_resolvers.each do |r|
23
25
  installed_resolver = File.join(install_path, File.basename(r))
24
- `sudo rm -rf #{installed_resolver}`
26
+ command += "rm -rf #{installed_resolver}\n"
25
27
  end
28
+ `osascript -e 'do shell script \"#{command}\" with administrator privileges'`
26
29
  end
27
30
 
28
31
  def registered_resolvers
@@ -5,18 +5,17 @@ module VagrantDNS
5
5
  class Service
6
6
  attr_accessor :tmp_path, :options
7
7
 
8
- def initialize(tmp_path, options = {})
8
+ def initialize(tmp_path)
9
9
  self.tmp_path = tmp_path
10
- self.options = options
11
10
  end
12
11
 
13
12
  def start!
14
- run_options = {:ARGV => ["start"]}.merge(options).merge(runopts)
13
+ run_options = {:ARGV => ["start"]}.merge(runopts)
15
14
  run!(run_options)
16
15
  end
17
16
 
18
17
  def stop!
19
- run_options = {:ARGV => ["stop"]}.merge(options).merge(runopts)
18
+ run_options = {:ARGV => ["stop"]}.merge(runopts)
20
19
  run!(run_options)
21
20
  end
22
21
 
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Dns
3
- VERSION = "0.4.1"
3
+ VERSION = "0.5.0"
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.4.1
4
+ version: 0.5.0
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: 2013-09-06 00:00:00.000000000 Z
12
+ date: 2013-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: daemons
@@ -93,3 +93,4 @@ signing_key:
93
93
  specification_version: 3
94
94
  summary: vagrant-dns manages DNS records of vagrant machines
95
95
  test_files: []
96
+ has_rdoc: