I currently have a LAMP (Ubuntu) server that I run in my house. My domain name is through GoDaddy. I want to have the ability to create subdomains dynamically using mod_vhost_alias.

I would also like to be able to change the DNS A-records of subdomains (for services like droplr).

Is this possible? Do I need to create a DNS on the server? Is it even possible to push my GoDaddy domain to it since it requires two IP addresses?

migrated from serverfault.com Sep 5 '11 at 1:56

This question came from our site for system and network administrators.


1: Do I need to create a DNS on the server No. You can use the GoDaddy DNS servers(maybe -depending on what type of IP address you have) see this BUT - This is dependent on whether or not you have a static or dynamic IP address from your ISP. If you didn't specifically order a static IP, then there's a 99% chance yours is dynamic which means it will probably change every time your router or modem reboots. <- this will require a solution before this will work.

Sorry if I'm telling you something you already know.

2: Why do you require 2 IP addresses? Unless there is something I'm not seeing, one IP address can serve many many virtual web sites.

So let me know if your IP is static or dynamic. If dynamic, what brand/model router are you using because come have built in support for dynamic IP addresses.

  • I have a dynamic IP... but it NEVER changes. In 3 years it has changed 1 times other than me moving. I thought if i hosted a DNS i needed to IP address. I want to be able to create dynamic subdomains. As in create a new folder and it is a subdomain. That is the first problem. The second problem is that I want to be able to have a subdomain like share.mydomain.com that I can change the A-Record to point to droplr to use their custom domain service. I am sorry for so many question. I'm terrible with Apache and want to learn. – jjNford Sep 5 '11 at 1:11
  • Ok, then go look up how to use the GoDaddy DNS servers in the link I posted earlier. For example, in the GoDaddy DNS admin, you'll create a new host called share under your domain of domain.com. Then give the newly created host an A record with the IP of your router. Set up http forwarding on your router, then configure Apache to handle the virtual hosts. Let me know if you need clarification on any of those steps. But first things first, set up the DNS at GoDaddy. – Cooter Sep 5 '11 at 1:25

I would strongly suggest that you get a cheap web hosting VPS first before trying this. At best, most ISPs don't' care too much about people hosting web sites at home without a business account. Worse case, your account can be suspended.

Putting aside that, if you do want to host your web site at home, do NOT presume that your IP will not get changed. Instead, get yourself a Dynamic DNS provider like these guys:


Which will update your DNS to your IP automatically when it changes (using either a script to a software client on your home computer). That said, charges for additional subdomains may apply. You will need to review their pricing and see if they will fit your needs.

However, if you are not planning to have your domain be exposed on the internet, you can setup your DNS yourself and use whatever domain you want, using either BIND, DNSMasq or other DNS software. NOte that DNS configuration itself even for the easiest software packages will take some work.

Finally, if you really don't want to mess with DNS and you just want to learn how to use Apache, just update your host file on your home computer when connecting to your Ubuntu box with the subdomains in question. So if you have a domain call foo.bar.com on your ubuntu box, add the following in your host file (I am using my Mac as an example). foo.bar.com

This is obviously not scalable in the long run.


You need to set a wildcard dns entry to be able to dynamically create subdomains on the fly (though what you're really doing is telling your DNS provider is to send EVERYTHING to your server, and weeding out with vhosts). This shouldn't need a seperate dns provider.


It's not a big deal if your IP changes and you are there to update your A-records to follow this, or by using a dynamic DNS updater.

Try Afraid.org for the DNS service. I've been using them - free, fast, easy to use, and reliable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy