External Wildcard DNS records

LawsHosting

Verified User
Joined
Sep 13, 2008
Messages
2,405
Location
London UK
Quick question.

If a domain has a wildcard (*) A record (not on the box), and the sub-domain (eg. test.) doesn't exist, is it normal for Apache to return the main vhost (domain.tld) for that sub-domain even if the ServerAlias hasn't a *.domain in it? :confused:

As we do not use nameservers on our boxes, I tell clients to add a wildcard A record so when they add sub-domains, they do not need to add an A record everytime.
 
If a wildcard (*) A record is set up, and a correct IP is assigned, it's up to you to configure Apache (add necessary domains, sub-domains) in order to get what you want.

If a requested domain or sub-domain does not exist, a user will see (with default apache and directadmin setting) either a stub with "Apache is functioning normally" or "This IP is being shared among many domains".

Of course if it is a dedicated IP (assigned to a user IP), then you'll see an index page of a default domain of the account.
 
Ok, so if a domain is on a shared IP, then it'll look at the sharedip index.html.

I'm asking for SEO reasons, like if a domain has a dedicated IP (my example), then search engines could index non-existent sub-domains, thus come under duplicate content - or even someone could submit wesuck.domain to search engines.

At the moment I added this to the htaccess:
RewriteCond %{HTTP_HOST} ^test.domain.tld$
..
..
RewriteRule ^(.*)$ - [R=410]
I was going to do this, but I realised it'll catch real sub-domains too:
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+).domain.com$
 
Back
Top