Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to ping by hostname #14

Closed
NicolasGeraud opened this issue Jan 20, 2014 · 4 comments
Closed

add ability to ping by hostname #14

NicolasGeraud opened this issue Jan 20, 2014 · 4 comments
Labels

Comments

@NicolasGeraud
Copy link

after a fresh "vagrant up", I'm not able to ping "vagrant-centos65.vagrantup.com".

Add this DN to the hosts resolve this.

Do you think this must be set in a fresh install ?

@casr
Copy link
Member

casr commented Jan 20, 2014

Do you mean within the base box itself? I think this might be a bit confusing to set in the base box's host file because it won't be shared by other computers in the network.

What are you trying to do?

@NicolasGeraud
Copy link
Author

After a vragrant up, I provision the VM with a tomcat based product (Liferay => www.liferay.com) which tried to resolve vagrant-centos65.vagrantup.com.
And I get an UnknownHostException.

So I put this in my Vagrantfile:
config.vm.provision :shell, :inline => "echo '127.0.0.1 vagrant-centos65.vagrantup.com' >> /etc/hosts"

@casr
Copy link
Member

casr commented Jan 20, 2014

I think this might be a bit confusing to set in the base box's host file because it won't be shared by other computers in the network.

Well I checked what happened when setting the hostname with config.vm.hostname and it resulted in that value being added to the line beginning with 127.0.0.1 in /etc/hosts. In that regard, I'm going to assume that upstream has thought about this more and I'll add it in the next release. :)

For now though setting the hostname with config.vm.hostname might be a simpler way of achieving your goal.

Thanks for the report!

@casr
Copy link
Member

casr commented Jan 20, 2014

Just to add, you'll need to make the hostname value something other than the original otherwise Vagrant will leave it untouched. For instance,

config.vm.hostname = "centos65.vagrantup.com"

should do the trick.

casr added a commit that referenced this issue Jan 20, 2014
Provides similar behaviour to when Vagrant sets the hostname in a
`Vagrantfile`. See GH-14
@casr casr closed this as completed Jan 20, 2014
ryross pushed a commit to RepublicProject/vagrant-centos that referenced this issue Dec 17, 2014
Provides similar behaviour to when Vagrant sets the hostname in a
`Vagrantfile`. See 2creativesGH-14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants