#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2001
    Location
    USA
    Posts
    830
    Rep Power
    14

    Host a subdomain on a different web server


    I'm not an expert on DNS -- I've never even set it up, but I think I get the general idea. I'd appreciate someone who is more knowledgeable confirming something for me.

    I have a website, call it example.com, hosted on web server "A". So, the site can be accessed by HTTP as example.com or www.example.com. Let's just say the nameservers are ns1.example.com and ns2.example.com.

    I want to host a subdomain of example.com, call it subdomain.example.com, on a different web server, call it server "B".

    To accomplish that, I believe there are two main possibilities:

    1.
    - Leave ns1.example.com and ns2.example.com as the authoritative nameservers

    - Add an A record like this:
    subdomain.example.com IN A #.#.#.# (IP address for server B)

    - Configure a virtual host for subdomain.example.com on server B

    Or

    2.
    - Add the appropriate records to the example.com zone to delegate authority for a new zone for subdomain.example.com

    - Configure the appropriate records in the subdomain.example.com zone

    - Configure a virtual host for subdomain.example.com on server B

    So that with the first approach, ns1.example.com and ns2.example.com will answer DNS queries for subdomain.example.com and with the second approach, other namservers (as configured) will answer the queries.

    Is that essentially correct?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    SoCal
    Posts
    9
    Rep Power
    0
    Both methods will work, but you shouldn't move delegation of a host record to another set of nameservers. That's typically done when you have a division which is going to control their own hosts. To your zone file just add

    newhost.example.com. IN A 12.13.14.15

    Make sure you add the trailing period to the tld, or the $ORIGIN will be appended to the end

    sample for BIND ver 9.x:

    Code:
    $TTL    8640
    $ORIGIN example.com.
    @                       1440 IN SOA     ns1.example.com. hostmaster.example.com. (
                                            22644           ; serial (d. adams)
                                            28800            ; refresh
                                            14400            ; retry
                                            3600000          ; expiry
                                            86400 )          ; minimum
    ;
    @               IN      NS      ns1.example.com.
    @               IN      NS      ns2.example.com.
    ;
    ns1             IN      A       1.1.1.2
    ns2             IN      A       1.1.1.3
    ;
    host1	IN	A	1.1.1.4
    host2	IN	A	2.2.2.4
    -Pete
    Last edited by dwellersoul; March 4th, 2003 at 07:54 PM.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2001
    Location
    USA
    Posts
    830
    Rep Power
    14
    OK, thanks for the info. I'm not the one who will actually be modifying the DNS records, but I need to know what I'm talking about and what is the best way to do what I'm trying to accomplish when I talk to the person that will.

    Both methods will work, but you shouldn't move delegation of a host record to another set of nameservers. That's typically done when you have a division which is going to control their own hosts.
    The situation is that example.com resolves to a Windows NT / IIS web server. What I need to do is have newhost.example.com resolve to a different server (LAMP) at a different hosting company.

    Delegating authority for the new host to the DNS servers at the second hosting company would be more flexible by allowing me to do things like set up subdomains of that domain using self-service administration software that is not available at the original hosting company. But realistically, I probably won't need to do those kinds of things, so as you recommend just adding the A record, that definitely sounds simpler. For mail routing purposes I might need them to add some additional records, e.g.:
    newhost.example.com IN MX 0 newhost.example.com
    correct?

    Thanks for replying, I appreciate it.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    SoCal
    Posts
    9
    Rep Power
    0
    Mail routing might not be needed unless you plan on having emails like bob@newhost.example.com, or you plan on using the mail server at the new hosting company.

    On the flip side, if the new hosting company allows you to manually update your zone records it might be easier just to move ns1.example.com and ns2.example.com to the new host. That all depends on your preferrence, and if the current company is quick to respond to your requests.

    -Peter
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2001
    Location
    USA
    Posts
    830
    Rep Power
    14
    Re: the mail. Yes, that's what I meant / want to do (use the mail servers at the other hosting company), insofar as I only want the first company's servers to handle DNS, not mail or anything else.

    The actual scenario is that the new hosting company provides the same DNS servers for all accounts, so they just have generic hostnames, e.g. ns1.ourdns.com. So ordinarily, if I just went and registered example.com, I would use their control panel to create a new account. They would set up the virtual host and configure their DNS to be authoritative for the domain and I would need to configure their DNS server names (ns1.ourdns.com) with the domain name registrar.

    However, since it is a third level domain that I am talking about, my original question . . .

    Make the current DNS servers that are authoritative for example.com the authoritative servers for newhost.example.com, adding the necesary records, e.g. an A, maybe an MX -- meanwhile don't do anything to the DNS data at the other hosting company

    Or

    Add the appropriate RRs to the current DNS data to specify ns1.ourdns.com and ns2.ourdns.com (at the other hosting company) as the name servers for newhost.example.com and set up the appropriate DNS settings on ns1.ourdns.com and ns2.ourdns.com to make them the authoritative name servers.

    Each hosting company I use (there are several) does things a little differently, but taking a particular one as an example -- they have a control panel for setting up new accounts. They do the DNS updates manually, but within 24 hours of setting up the account in the control panel. But I'm in no big rush anyway, it's much more important to get this setup in the way that is best for the long run.

    I hope I'm making sense. Do you see what I mean?

    Thanks for the continued help.
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    SoCal
    Posts
    9
    Rep Power
    0
    I think in short you would be better of keeping everthing on one name server, makes it much easier to manage and keep track off. This is especially true when only one person is maintianing the zones through many different interfaces. I think the KISS principle does apply here.

    -Pete
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2001
    Location
    USA
    Posts
    830
    Rep Power
    14
    Yeah, OK, that sounds reasonable. I'll arrange to do it that way unless I learn of a good reason to delegate the new zone.

    Thanks for your input. I don't have that much experience with DNS issues, so your more-informed advice is helpful.
  14. #8
  15. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    SoCal
    Posts
    9
    Rep Power
    0
    No problem at all, if you have any more questions feel free to ask. I ran some very large nameservers out there, 2 million+ domains across multiple boxes, including the bulkregister.com nameservers for a bit.

    -Pete

IMN logo majestic logo threadwatch logo seochat tools logo