-2

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.

DAKSH
  • 127
  • 1
  • 5
  • 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 01:09

2 Answers2

1

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.

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92
0

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.

Tutul
  • 892
  • 6
  • 20