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.
closed as not a real question by SvW, 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.
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.