Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Let'say that i've got the domain mydomain.com.

I want that when any visitor goes to
www.mydomain.com
xyz.mydomain.com
abc.mydomain.com
asd.mydomain.com
qwe.mydomain.com
etc...

the visitor will continue seeing "xyz.mydomain.com", but the real address will be "mydomain.com". my asp.net application will handle the differences between the addresses. I want that the subdomain can be anything.

The problem is: I'm using a shared host. They allow me to create subdomains and allow me too create some DNS records:

Address (A)
CNAME
Mail (MX)
IPV6 (AAAA)
TXT

There is possible setup my hosting to accept that asterisk/wildcards for subdomains? How I do?

share|improve this question
    
You should consider the SEO implications of this. –  Dave Cheney May 26 '09 at 4:12
    
What SEO implications? Do the search engines demote listings from wildcarded sites or that aren't www.{domain} ? –  Alnitak May 26 '09 at 8:59
    
If x.abc.com and y.abc.com contain the same information, they will: a) be diluted b) possibly be demoted for "googlebombing" -- setting up multiple identical sites is considered bad form by search engines. A better solution might be to redirect *.abc.com to www.abc.com. –  Ben Doom Jul 27 '09 at 18:03
    
It's not a problem. Just use canonical urls: support.google.com/webmasters/answer/139066?hl=en –  Leonard Challis Jun 12 at 8:18

3 Answers 3

up vote 4 down vote accepted

Try creating an A or CNAME record with * as the subdomain and your server's IP (A record) or domain (CNAME record) as the destination. If your host's control panel doesn't permit a wildcard, you'll have to contact them for help, or move your DNS to a third party.

share|improve this answer

Some advice against wildcard web sites:

What will you do when someone starts publicizing your website as "http://this.company.sucks.domain.com" and it resolves / renders correctly?

share|improve this answer
    
Agreed. Just make a single A record for the hostname of the server and then you can make aliases for the websites themselves. Doing this will help you if you ever need to change IP addresses again. –  Tatas Jul 25 '09 at 17:33
2  
The use case for this is usually for things like account_name.example.com in web applications - highly useful, and a nightmare to set up manually on a DNS server if you've lots of signups. If someone publicises this.company.sucks.example.com, you can always set up a spurious A record for that particular subdomain. –  ceejayoz Dec 17 '09 at 22:15
    
Or in your Web server software, where I assume you would alias xyz.example.com to the xyz site, have any unmatched queries (still pointing at the same server) use a normal redirect, so the browser changes to example.com or www.example.com. You could even throw in a 404 page at the end of the redirect. –  mpbloch Apr 12 '10 at 0:30

A Bind DNS server allows you to create wildcard A records like this:

*.mydomain.com. IN A x.x.x.x

Or, if they are using a web control panel, create an A record for the host * , at your IP address.

Windows 2000 DNS server takes some effort to use wildcarding:

Step 1. Enable LooseWildcarding. Loose Wildcarding http://technet.microsoft.com/en-us/library/cc940790.aspx

Step 2. Use Dnscmd to create the Wildcard record. http://support.microsoft.com/default.aspx?scid=kb;en-us;840687

I'm not sure about Server 2003 and newer - there was an issue with wildcards in Server 2003 DNS not working if you have WINS forward lookup enabled

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.