Forum Moderators: phranque

Message Too Old, No Replies

Subdomain creation -- bypassing my webhosting provider?

Services like mydomain.com an option?

         

ThatAdamGuy

9:22 am on Jan 14, 2003 (gmt 0)

10+ Year Member



Hi there,

I registered my domain via godaddy and currently have it hosted via a separate Web hosting company (my "host").

My host is not willing to offer me wildcard DNS, and only provides a limited number of subdomains for free.

Given this, are services like mydomain.com an option for me? I read through their site documentation and was, I'm embarrassed to admit, thoroughly baffled.

My gut take is that I'm not going to get any subdomains other than via my host, but I'd love to be proven wrong!

DaveAtIFG

3:33 pm on Jan 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm a little confused by your question. Godaddy and MyDomain.com are both domain name registration services so you will need to use one or the other. If one offers services that the other does not, and you need the services, move your domain registration there.

My host is not willing to offer me wildcard DNS, and only provides a limited number of subdomains for free.

If you are planning to try to circumvent this, you will be in violation of your host's TOS. Also, it's probably illegal in many places.

ThatAdamGuy

4:51 pm on Jan 14, 2003 (gmt 0)

10+ Year Member



From their homepage:
Mydomain.com is the superior choice for domain registration and free dns management and will quickly and easily help you manage your domain names free, no matter where you registered your domain names.

Hopefully that clarifies why I mentioned them :)

Illegal? Using a different company for DNS?

And frankly, I can hardly see why my hosting provider would or should care. I'm not looking to create company1.mysite.com and company2.mysite.com or fred.mysite.com and sarah.mysite.com. I'm just looking to topically divide up my site (e.g., humor.mysite.com, pictures.mysite.com, about.mysite.com) for SEO and making it more convenient for visitors. In other words, my hosting provider is gonna serve the exact same number of documents (barring SEO-based improvements) whether it's topic.mysite.com or mysite.com/topic

DaveAtIFG

5:59 pm on Jan 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You are mixing two issues and topics.

You are free to use any domain registrar you choose. Your original post implied that you were considering doing this to circumvent your host's limit on subdomains. Circumventing that limit may be illegal.

I can hardly see why my hosting provider would or should care.
For the use you describe, he probably shouldn't. But he set some limits and policies to protect himself from others who may want hundreds of subdomains eating up significant bandwidth.

dingman

4:00 am on Jan 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is yet another issue here. You can switch your DNS to another provider, no problem as long as you own the domain. You can then have your new DNS provider stick in as many subdomains as you like, even a wildcard, all resolving to the IP you are on at your hosting provider. Nothing they can do about that. However, all of that won't give you working subdomains on your web site. It will give you broken subdomains. Why?

In order for the same server to serve different content when addressed by different names, the server needs to know what content goes with the name. That's part of the server configuration - you can't specify a virtual host in an .htaccess file. Suppose you have a hosting account set up for 'www.example.com', at ip 127.0.0.1, and you just change the DNS to add sub1.example.com pointing to the same IP address. What happens when someone asks for 'http//sub1.example.com'? Any of a number of things. Suppose you have a dedicated IP.

(1) browser looks up sub1.example.com, and finds out it's address is 127.0.0.1.

(2) Browser sends a request to 127.0.0.1. Assuming it is an HTTP 1.1 compatible browser, it includes in its request the fact that it was using the name 'sub1.example.com'.

(3) Server doesn't care what name was used, as there are no names to choose between on this IP anyway. Server sends back content for www.example.com. Not horrible, but pointless and possibly embarassing.

If instead you have a shared IP with name-based virtual hosting, it gets worse. (1) and (2) stay the same, but for (3), the server does care what name was used. It looks for 'sub1.example.com' in its list of configured names, and doesn't find it. At this point, the server guesses. Either your hosting provider has configured a default virtual host, and that content gets chosen, or the server falls back to whatever virtual host is first in its configuration file. Oops. You just sent your customer off to visit someone else who just happens to have their site on the same shared server. If you are extremely lucky, you happen to be the first configured name-based virtual host, and it's only as bad as it would have been with a dedicated IP. How slick and professional...

ThatAdamGuy

5:00 am on Jan 15, 2003 (gmt 0)

10+ Year Member



Dingman,

Thanks for that thorough and interesting explanation. What I'm curious to know, though, is whether using mod rewrite rules in my .htaccess would work with your #2. After all, when someone types in blog.mysite.com (set up by my hosting company), the rewrite rules I've used in my .htaccess file correctly bring both regular visitors and bots to files served in mysite.com/blog (completely transparently, too).

But assuming even this would not work, how can MyDomains.com make such a statement on their front page:

The MyDomain Services are designed to work with any domain name regardless of where you registered it and allows you to: [...] Create subdomains

Is this an issue of semantics, e.g., sure, you can CREATE all the subdomains you want, but they won't actually work? :D

I guess I lack also a basic understanding of the technical underpinnings of DNS. What goes on when my Web hosting provider "creates" a subdomain for me? When someone types in blog.mysite.com, are they going actually a different IP address? This seems NOT to be the case, because when I did an nslookup on blog.mysite.com, I got exactly the same IP address as mysite.com.

I apologize for being a bit clueless with all of this, and if you'd like to suggest a resource I could check out online to learn more about this, I'd happily follow up on that :)

dingman

1:24 pm on Jan 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might be able to do something with rewrite rules to turn, say, 'sub1.example.com' into 'www.example.com/sub1', provided that you have a dedicated IP address.

sure, you can CREATE all the subdomains you want, but they won't actually work?

From a DNS perspective, they do. If you look up the name of the new subdomain, you get back an IP address. From there, it's not a DNS issue but rather a web server configuration issue whether the domain behaves as you expect.

If you already have 'www.example.com' and 'blog.example.com' working, and they point to the same IP, then your host has already set up name-based virtual hosts for you on that IP, one that gets served for requests for 'www.example.com' and one that gets server for requests for 'blog.example.com'.

Neither of these is a really light-weight discussion of the issues involved, but they may help:
[httpd.apache.org...]
[isc.org...]

[edit]added a word for clarification[/edit]

Crazy_Fool

4:15 pm on Jan 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>I can hardly see why my hosting provider would or should care

because they have to make a living too ..... and they can't do that if people are defrauding them ....