Best Practice for using hostnames instead of IP addresses
Posted: 6. Jul 2010, 20:30
I'm new to Virtual Box and somewhat new to Linux in general.
I would like to setup several CentOS 5.5 virtual machines for web application development. Right now, I only need a vm for the web server and an additional vm for the database server. I would like to be able to give these machines hostnames in such a way that one can refer to another in addition to being accesible by the host.
For example, having the web server something like, "web1.vm". This VM would then be able to reference "database1.vm" in any of my web application's source code. I would also like to be able to open my Host's web browser and type in web1.vm to access the web server.
Is this possible, without modification to the Host's networking information; modifying /etc/hosts. I want something I can easily share. I am using MacOS X Snow Leopard as my current host, but hope to share all the VM's as a virtual appliance with the rest of my development team.
I know when I have two Mac's on a network I simply have to type in computerName.local and I am able to connect to the machine without knowing it's IP address. I'm looking for the same basic functionality so I don't have to worry about hard coding IP addresses.
Thanks for any and all suggestions!
I would like to setup several CentOS 5.5 virtual machines for web application development. Right now, I only need a vm for the web server and an additional vm for the database server. I would like to be able to give these machines hostnames in such a way that one can refer to another in addition to being accesible by the host.
For example, having the web server something like, "web1.vm". This VM would then be able to reference "database1.vm" in any of my web application's source code. I would also like to be able to open my Host's web browser and type in web1.vm to access the web server.
Is this possible, without modification to the Host's networking information; modifying /etc/hosts. I want something I can easily share. I am using MacOS X Snow Leopard as my current host, but hope to share all the VM's as a virtual appliance with the rest of my development team.
I know when I have two Mac's on a network I simply have to type in computerName.local and I am able to connect to the machine without knowing it's IP address. I'm looking for the same basic functionality so I don't have to worry about hard coding IP addresses.
Thanks for any and all suggestions!