I do not know anything about this DNS stuff. I don't even know if this should be on stackoverflow or serverfault but anyways...

I have a site at example.com whose IP is, I have subdomain at sub.example.com whose IP address is also This site is registered at GoDaddy.

I am assuming that my site is on a virtual host since shows me a different page than my homepage at http://example.com, and I am on shared hosting

The server is running Apache 2.2

Now I have another domain (my-other-domain.com) which is not registered with GoDaddy and somebody else is managing it. All he asked is for the IP address of the server (which is I want my-other-domain.com to point to sub.example.com. If he makes an A-Record to make my-other-domain.com point to my server's IP which is, where will it go? And do I need to edit my A-Records too? Because I am assuming that my site is on virtual host, I do not have the assurance that my nameservers already know for whom my-other-domain.com is!

I do not have access to Apache conf files. Anybody familiar with the GoDaddy control panel?


The technology in use is called name based virtual hosting. The web server reads the host header from the client request, searches the list of hosts that are on it and then presents the relevant website or a default it a match fails.

You will need to configure your sub.example.com to be an alias for my-other-domain.com. This is most easily achieved through the ServerAlias directive within the VirtualHost definition for sub.example.com

<Virtualhost *:80>

    ServerName sub.example.com
    ServerAlias my-other-domain.com

  • I don't think I have access to the configuration files of Apache. – Rolando Cruz Sep 14 '11 at 7:22
  • You probably need to speak to godaddy to see if they can help. – user9517 Sep 14 '11 at 7:28

You have to understand how DNS and Apache/HTTP relate.

  • If you contact from your browser, it will contact the server directly and asks for the default document for the site, which is usually not your main site on a shared hosting but something the provider configures.

  • If you contact http://example.com, your Browser will ask the DNS for the address example.com ( and will then contact the server and asks for the default document for the site example.com, which is your main site.

  • The same is true for sub.example.com, but of course it will ask for the default document for this sub-site.

  • If you now have this other domain my-other-domain.com, your browser will get the same IP as before and ask the server for the default document for this domain, but since Apache doesn't know about a site with this name, it will fall back to the default case as in the first case and will deliver the default document like with (this is the most likely configuration, but others are possible as well).

As a result, what you need to do is to configure Apache for the new domain. How this is done is largely dependent on the system you are on. It could be some config panel software like Plesk, or the provider would need to do it himself or you could be required to edit a config file manually.

Your Answer

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

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