Best Practice for using hostnames instead of IP addresses

Discussions about using Linux guests in VirtualBox.
Post Reply
jkramlich
Posts: 1
Joined: 6. Jul 2010, 20:11
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: CentOS, WinXP

Best Practice for using hostnames instead of IP addresses

Post by jkramlich »

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!
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Best Practice for using hostnames instead of IP addresses

Post by Sasquatch »

This sounds more like getting an internal DNS working between your systems than a real VB question. Please try a more specialized forum or a search engine to find information on how to set up a DNS system on your home network. This forum is not made for that.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply