1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Issues with Domains and Subdomains

Discussion in 'Server Configuration and Hosting' started by Eoj Nawoh, Nov 20, 2013.

  1. Eoj Nawoh

    Eoj Nawoh Active Member

    Alright, I'm in a complicated spot right now.

    I own my site and have a few domains on it with their own file directories. Normal stuff.

    Well I volunteered to make a forum for a group I help out with on my site.

    The problem is they have their domain, and want to have the forums on a subdomain. Ex:
    www.exampledomain.com leads to their 'Under Construction' Page (eventually becoming a WordPress)
    and they want
    forum.exampledomain.com to be there forum, and they want to keep their DNS management.

    We tried IP a record, it went to my main site, we tried setting unique name servers for their domain and it did create an A record in my Cpanel, but I'm not able to change the IP.

    Also, they want the site to be forum.exampledomain.com, so we can't just do a re-direct.

    If anyone knows how to do this, please help.

  2. rainmotorsports

    rainmotorsports Well-Known Member

    The A record should be in their DNS pointing to your server IP.

    On your side of the server there should be a record pointing incoming requests for forums.exampledomain.com to the folder on the server. Its been a long time since I have done a hosts record for say apache but on IIS there was an actual dialog for it. I imagine your cpanel has such an area.

    In apache its like this:
    Edited the second example for your situation. Out of the box pretty much any domain or subdomain pointed to your IP is going to resolve to either nothing, or your main site. The server software has to know what hostname ties to what location on your server.
    Last edited: Nov 21, 2013
  3. Eoj Nawoh

    Eoj Nawoh Active Member

    So I'd need to edit the apache for this?
  4. rainmotorsports

    rainmotorsports Well-Known Member

    Quite possibly there is no "easy" way to do this. I did a quick google for "cpanel virtual hosts" and this was the first result. http://forums.cpanel.net/f34/creating-new-virtual-host-59584.html It discusses not your issue but finding and editing the hosts file.

    However further googling turned up this (I have never been inside cpanel) - http://i.stack.imgur.com/KSIml.jpg
    Ignore the circled area as its not my image. But once the entry is in there you see an edit icon next to the document root.

    Have you tried putting in the subdomain and changing the document root to where the forum is installed on the server. This should create the virtual host record for you and with their DNS for that subdomain pointed to your IP everything should be in order.

    Manually editing the hosts configuration will likely be overwritten by cpanel so it should be done in the correct place in cpanel. It should only take a few minutes to sort this.
    Last edited: Nov 21, 2013
  5. Tracy Perry

    Tracy Perry Well-Known Member

    They need to edit their DNS entry to point at your server IP
    You need to edit your apache (or nginx) configuration to create a virtual host serving the domain name that they are using (Are they actually wanting to use a domain name of forum.whatever.com? - if so then you may need to create 2 vhosts, one for their landing page and another one for forum.whatever.com if they are wanting it to be accessed by that domain name
    If you are going to server mail for them also you will need to edit your MTA so that it recognizes the domain that they are using

    Again, since you say they want to keep their DNS management, THAT is where they need to change the IP's to reflect your server IP.
  6. Eoj Nawoh

    Eoj Nawoh Active Member

    I've set up plenty of subdomains that way, however, I'm not managing the actual domain, which seems to cause the issue.

    I'd much rather prefer them to just have the DNS on our site, then I can easily do the domain and point the home page at the IP for the landing page, since it's the only site on the IP.
  7. rainmotorsports

    rainmotorsports Well-Known Member

    Right however it shouldn't be a problem. Wether you control the domain or not if its pointing at your IP your server controls the destination of the final request. The fact that it resolved to your main site just means your webserver is not configured properly to serve content from the proper directory to requests for that hostname.

    TBG's domain for example is pointed to our gaming providers nameservers so that our various departments can manage subdomains through the same control panel as the game servers. However the web hosting for various components are on completely different servers nationwide running different OS's and server software and at the end of the day if I wasn't holding the keys to the domain I could still complete the server side job that your doing.

    This is a pretty normal case. Pointing a domain or subdomain to an IP using their DNS has to be followed up with a hosts record on your server the same way any other records that exist now are done. When a request goes to their DNS and is pointed to your IP the webserver will do one of two things without a host record. It will either load the default website if one exists or it will error saying that it doesn't know the hostname. If their subdomain is pointed to your IP right now then all that should need to exist is the host record.

    Remember it usually takes 10 minutes to an hour for DNS record changes to propagate so don't be impatient in determining success or failure. Worst case scenario 24 to 48 hours. But that only applies to their making a DNS change. Your host changes should be instant after a process restart.

Share This Page