Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to Ubuntu (having just installed Ubuntu 12.10) and want to start developing with it. So I have installed Vagrant, downloaded, initialized, started it up and accessed it via ssh.

To the test the Internet connection on my client I've done ping and received unknown host: (Host got ping of course.)

Searching the web only got me to this solution which suggested to remove Vagrant and Virtual box, and re-install them, just make sure Vagrant installed first. I've tried this solution and I am still getting the same results.

What else can I try to get it to work?

share|improve this question
There was an issue with my server client getting a DNS. Using google DNS, changed in /etc/resolv.conf and added to /etc/network/interfaces solved the problem. – Shahar Galukman Jan 9 '13 at 16:27
Can I ask you which tutorial you are using? Just a guess: is it gettingstartedwithdjango? If so, I will contact the author to refer to the present problem. If not, I will delete this comment. – don.joey Mar 13 '13 at 10:55
I'm not using the tutorial you mentioned. Found the solution using common sense yet bayoffire solution is much better, also it's known bug as he mentioned so I do belive it'll be fixed in future release. – Shahar Galukman Mar 19 '13 at 13:05
up vote 27 down vote accepted

I had the same issue with Ubuntu 12.10 and found a solution. Just add those lines to your Vagrantfile:

config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
config.vm.customize ["modifyvm", :id, "--natdnsproxy1", "on"]

For Vagrant 1.1+ you will need (thanks to farooqsadiq)

config.vm.provider "virtualbox" do |v| 
  v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]

It seems to be a known bug in VirtualBox on Ubuntu 12.10:

share|improve this answer
Good to know it is a known bug, even though I didn't managed to find something about it myself. The workaround I've mentioned in my comment above solved it for me though. At least other peoples with same error will have two different ways to solve this issue. Thank you. – Shahar Galukman Jan 12 '13 at 9:24
Even more about this issue. Your solution will be more appropriate since DNS configuration made manually (as suggested by me above) will be deleted every time I start the VM – Shahar Galukman Jan 12 '13 at 9:26
See this answer for a solution on newer versions of Vagrant: – Brad Oct 14 '13 at 15:45

For Vagrant 1.1+ you will need

config.vm.provider "virtualbox" do |v| 
  v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]

Tested on Vagrant 1.2.2

Found on Lyte's Blog

share|improve this answer
this fixes the following error: Cannot add PPA: 'ppa:brightbox/ruby-ng'. Please check that the PPA name or format is correct. on Ubuntu 14 with vagrant 1.7.2 and virtualbox on macos. – nruth Feb 5 '15 at 22:43

You can make the modifyvm trick work across all Vagrant VMs in one hit by putting a snippet in ~/.vagrant.d/Vagrantfile, e.g.: do |config|
    config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
share|improve this answer

The (new) default Vagrantfile* contains a bunch of commented-out examples, one of which is as follows:

  # Assign this VM to a bridged network, allowing you to connect directly to a
  # network using the host's network device. This makes the VM appear as another
  # physical device on your network.
  # :bridged

Make sure you un-comment this line: :bridged

That will give your virtual machine access to the network/Internet.

* As of version 1.0.6. As of the time of this answer, the latest version in the repository is 1.0.3, it may not have all of the extra examples; in which case, you'll need to add that line of code.

share|improve this answer
I would use this only, if NAT does not work. Bridged networks do only work, if you get an IP from the HDCP to the virtual machine. See this: (not all networks work!) – lukassteiner Jan 23 '13 at 15:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.