Merge pull request #1176 from paulv/master

Fix for DNS resolution bug on Ubuntu 12.10
This commit is contained in:
Mitchell Hashimoto 2012-10-12 20:01:37 -07:00
commit 5b4a132fdd
1 changed files with 5 additions and 4 deletions

View File

@ -29,13 +29,14 @@ module VagrantPlugins
begin begin
contents = File.read("/etc/resolv.conf") contents = File.read("/etc/resolv.conf")
if contents =~ /^nameserver 127\.0\.0\.1$/ if contents =~ /^nameserver 127\.0\.0\.1$/ or
contents =~ /^nameserver 127\.0\.1\.1$/
# The use of both natdnsproxy and natdnshostresolver break on # The use of both natdnsproxy and natdnshostresolver break on
# Ubuntu 12.04 that uses resolvconf with localhost. When used # Ubuntu 12.04 and 12.10 that uses resolvconf with localhost. When used
# VirtualBox will give the client dns server 10.0.2.3, while # VirtualBox will give the client dns server 10.0.2.3, while
# not binding to that address itself. Therefore disable this # not binding to that address itself. Therefore disable this
# feature if host uses the resolvconf server 127.0.0.1 # feature if host uses the resolvconf server 127.0.0.1 or 127.0.0.1
@logger.info("Disabling DNS proxy since resolv.conf contains 127.0.0.1") @logger.info("Disabling DNS proxy since resolv.conf contains 127.0.0.1 or 127.0.1.1")
enable_dns_proxy = false enable_dns_proxy = false
end end
rescue Errno::ENOENT; end rescue Errno::ENOENT; end