Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 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.

1  
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
add comment

2 Answers

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
add comment

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
add comment

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