Setting up sub-domains so they work properly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samsam
    Member
    • Mar 2004
    • 79

    #1

    Setting up sub-domains so they work properly

    Hi:

    I want to setup a sub-domain of one of my sites so that people who click on:

    forum.foobar.com

    are REALLY taken to forums.anotherhost.com/index.php

    but never know it, because the URL for the remote forum is now always using the 'forum.foobar.com' sub-domain prefix.

    Ideally, this should work not as domain 'masking' does, but should ensure that all the files on the remote site also look like:

    forum.foobar.com/index.php
    or
    forum.foobar.com/query.php?2345 etc etc

    How it works at the moment is not great:

    I used cPanel to create the the sub-domain 'forum.foobar.com', and it successfully re-directs people to forums.anotherhost.com, and you see 'forum.foobar.com' in the address bar, as you should. So far so good...

    But as soon as you click on a link on the site, and PHP kicks in or whatever, the URL changes to 'forums.anotherhost.com/index.php' etc. And people can see that the have left my site and are on another one.

    But if you hover over a link on any of the site pages, they have the 'forum.foobar.com' prefix in them, so they know about the sub-domain 'owning' them..

    Weird. Any suggestions.

    Sam
  • Jonathan
    Senior Member
    • Mar 2004
    • 1229

    #2
    y not put a index.php page in the subdomain so that
    it has a frame where the top is like 1px or something?

    Then basicly have buttom frame load forums.anotherhost.com
    and basicly the url should stay forums.yoursite.com
    "How can someone be so distracted yet so focused?"
    - C

    Comment

    • Pedja
      Senior Member
      • Mar 2004
      • 329

      #3
      You do not set subdomain for forum.foobar.com but park domain on top of forums.anotherhost.com or set addon domain for anotherhost.com.


      If you park forums.foobar.com on top of forums.anotherhost.com then no matter which those two visitor uses, site will work fine.

      If you set addon domain forums.foobar.com on anotherhost.com, script will actualy create subdomain forums.anotherhost.com and then park forums.foobar.com on top of it.


      There is limitation: You cannot park subdomain of one domain hosted on your account (or server) on other domain hosted on the same server. I managed to overcome this limitation but Andrew was not so happy with my solution and advised not to use it. So I can't tell you what I did.

      Pedja

      Comment

      • samsam
        Member
        • Mar 2004
        • 79

        #4
        Thanks everyone, but I am still unclear what needs to be done.

        The issue is that I want forums.foobar.com to point to forumrealhome.smith.com, where smith.com is a host outside of Dathorn.

        What the helpdesk at the other host have advised is the following:

        edit the DNS for foobar.com to add a A Entry for
        forum.foobar.com to point to 12.34.56.78 [their nameserver], it should look similar to
        this...

        forum 14400 IN A 12.34.56.78

        Once that is done just let me know and I will go ahead and make the necessary changes on our end to set this up for you.
        So in the (hopelessly un-friendly) WHM I went into the 'Edit Zone Templates' bit, selected 'simple', and in the screen below this is what I added:

        ; cPanel %cpversion%
        ; Zone file for %domain%
        $TTL %ttl%
        @ IN SOA %nameserver%. %rpemail%. (
        %serial% ; serial, todays date+todays
        14400 ; refresh, seconds
        7200 ; retry, seconds
        3600000 ; expire, seconds
        86400 ) ; minimum, seconds
        %domain%. IN NS %nameserver%.
        %domain%. IN NS %nameserver2%.
        %domain%. IN NS %nameserver3%.
        %domain%. IN NS %nameserver4%.

        forum. IN A 12.34.56.78
        %domain%. IN A %ip%

        localhost.%domain%. IN A 127.0.0.1

        %domain%. IN MX 0 %domain%.
        I added a "." full-stop after the forum entry, since all the other domain entries had them, and I left off the 14400 bit because it seems they are set up as defaults in the entry here.

        The idea, I guess, is to add into the DNS record for foobar.com an instruction that any calls to 'forum.foobar.com will get passed to the remote DNS server 12.34.56.78 at smith.com to be resolved, where that nameserver will map it on top of forumrealhome.smith.com.

        That's the theory. DNS propagation delays are slowing down my ability to test this, and I think support at the remote host have taken an early weekend too, so I am not sure if they have setup there end yet.

        I'll let you know if it works in a few days, but I would be happy to hear from anyone if there is an error in how I have made the WHM DNS zone entry...

        Sam

        Comment

        • Dan
          Member
          • Mar 2004
          • 99

          #5
          RUT ROH...you wanted to edit the zone record for fobar.com...not a template. The templates are used when creating new domains whereas you want to edit an existing one.

          Comment

          • samsam
            Member
            • Mar 2004
            • 79

            #6
            RUT ROH...you wanted to edit the zone record for fobar.com...not a template. The templates are used when creating new domains whereas you want to edit an existing one
            .

            Yeah, I realised that soon after making the change. I hate DNS.

            Anyway, I think I am on the way to getting this sorted out. I buckled under the confusion of it all and have submitted a Dathorn TT...

            BTW, some DNS management interfaces make it a whole lot easier than WHM does.

            I just had a look at MyDomain.com again, as it is managing DNS for a few of my other domains, and doing all this sort of stuff (eg creating a sub-domain and adding a A record for it) is MUCH easier there. They have a simpler form based interface onto the task, whereas WHM is very cryptic and minimal in its DNS interface. The split between 'do a little bit in WHM/ a bit in cPanel' is also not elegant.

            Once this is sorted out and stable, FWIW I will add mydomain in as a tertiary nameserver for the domain in question too, to supplement the two Dathorn ones active on that domain, for redundancy purposes.

            Comment

            • brett
              Member
              • Mar 2004
              • 45

              #7
              Thank you samsam for your insight. Please post the solution to your findings if you can, when it happens. I'm trying to figure out if I should manage DNS elsewhere or here, on Dathorn servers. I'd like to perform similar functions pointing subdomains to other IP's, etc... No need right now, but I know that this is something I can use and would like to know.

              Comment

              • samsam
                Member
                • Mar 2004
                • 79

                #8
                The Dathorn techs fixed it up the Dathorn end of my DNS in about 15 minutes after I submitted the trouble ticket.

                Yet another example of the great support Dathorn have to offer.

                An 'A' entry for the DNS was created that now points off from the domain record held in my custom Dathorn nameserver to the IP address of the remote site's nameserver.

                The guys at the other provider were also very helpful, and now they have done their bit to map the 'forum' subdomain onto the right subdomain location on their system, and it all works fine.

                It probably would have sped things up considerably at the Dathorn end if I had just gone right ahead and submitted a TT to Dathorn right at the beginning, but I thought I could manage it myself via WHM and cPanel. Alas I was wrong.

                Still, the whole process only took 1 day from go to whoa, which is not bad since it involved DNS changes at two hosting service providers.

                The main reason I was doing it was to host an Invision forum off-site, so I could turn on all the bells and whistles of the software without having to worry about it hogging the CPU on my Dathorn server.

                I chose to host it directly with Invision - they do it pretty cheap ($10/month, cheaper for prepaid), and they throw in a free license and free upgrades to the next version etc etc, which they will do for you. And since they wrote the app, their support for it is excellent. One less thing to worry about.

                It also gave me some redundancy in that site, inasmuch as if Dathorn has glitches, at least the forum will be alive, and that's where I expect most users will be.

                Mydomain is a very handy service and has some advantages over using Dathorn's DNS, in the sense that it is slightly easier to configure yourself, and you also get access to up to 5 (I think) nameservers you can put into your DNS records for a domain. Unlike the Dathorn DNS, these nameservers are spread across multiple locations and systems, so you get a bit more robustness and performance, theoretically, out of it too. And Mydomain's DNS management is also free, but quite reliable.

                Hope this has been useful.

                Comment

                • brett
                  Member
                  • Mar 2004
                  • 45

                  #9
                  Thanks for the update! I still wish I knew how to do this in cPanel/WHM. I suppose I'll just trial and error or hope someone will post how to accomplish what you did, using the tools we have available to us.

                  Comment

                  • Pedja
                    Senior Member
                    • Mar 2004
                    • 329

                    #10
                    Just look how other A records in DNS zone are set and do it in the same maner except use other subdomain and other IP.

                    For most services that is enough, but for http, server where subdomain is hosted must be set to handle requests tageted to that domain (vhost).

                    Pedja

                    Comment

                    • openbox
                      Senior Member
                      • Mar 2004
                      • 238

                      #11
                      Or, if you aren't comfortable with DNS, submit a trouble ticket explaining what you want done.

                      Comment

                      Working...