Forum Moderators: phranque
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!
My host is not willing to offer me wildcard DNS, and only provides a limited number of subdomains for free.
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.
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
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.
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...
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
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 :)
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]