Server Fault is a question and answer site for system and network administrators. 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 have installed centos in fedora virtualbox. I would like to create a webserver in centos. Which would resolve dns on dynamic ip. Can I do that. If i can then how? I don't have a router or static ip.

share|improve this question

closed as not a real question by Sven, EEAA, sysadmin1138 Oct 22 '12 at 2:35

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Can you? Sure. Should you? ABSOLUTELY NOT. More importantly, can you please enlighten us as to how this falls within the scope of the site as defined in our FAQ? Normally I'd give you the benefit of the doubt but I can't see this fitting into the scope of a professional sysadmin's job. – voretaq7 Oct 22 '12 at 1:09
up vote 1 down vote accepted

You can do it. DNS resolution to dynamic IPs tends to be unreliable, but you certainly can do it. I would strongly recommend not doing this in production (virtualbox and dynamic IPs for servers are both major reliability issues).

Virtualbox offers you two ways you can connect your VM to the internet: bridged networking, where the VM would get an IP address from your ISP and essentially be directly connected to the internet, or NAT, where it gets an IP address from virtualbox. If you are using the latter, you will have to forward port 80 and 443, or the ports of your choice, to it. Virtualbox offers GUI options for this.

You may also benefit from using a dynamic DNS service if you plan to have it up for a while.

Also, a minor point of terminology: the webserver doesn't really resolve DNS (though the server it is running on might). You cannot effectively serve DNS on a dynamic IP without massive maintenance overhead and downtime. For resolving DNS names by querying other servers, there are no complications introduced by dynamic IPs or being connected directly to your ISP at all. However, I assume you mean the DNS name for your site will resolve to a dynamic IP.

Check also that your ISP's ToS permits you to run servers. Typically, services that do permit this come with at least one static address. Plenty of ISPs either block incoming connections to you on ports 80, 443, 20, 21, and others without an established state, and plenty more scan for your servers.

share|improve this answer

You can do NAT port forwarding for opening the webserver port to outside world, and use a dynamic dns client (scroll down to unix clients section) to update the ddns service of your IP.

share|improve this answer

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