Block all subdomains, even on different domains, loading the default website

1 post / 0 new
#1 Sun, 11/30/2014 - 02:38
fakemoth
fakemoth's picture

Block all subdomains, even on different domains, loading the default website

Hello. So how do I block all subdomains, even on different domains, loading the default website? To make it clear; my main DNS/hosts servers are called ns1.mumu.ro and ns2.mumu.ro; I also have a website on mumu.ro. But ALL the other mail subdomains, and ALL the https connections, from ALL the other domains are loading in fact my default mumu.ro. Example:

mail.somedomain1.com > loads in fact the website originally on www.mumu.ro

mail.somedomain2.com > loads in fact the website originally on www.mumu.ro

or

https://somedomain3.com > the same

I need this to stop and asked here a while ago; the answer was that it is a feature. OK how do I get rid of this damn "feature"? As I understand it Apache loads the first virtual host, if you make use of wildcards. No wildcards in my domains or virtual hosts. In fact will surely load the first virtual host no matter what, so I need to have some dummy virtual host in front of it. How should that one look like, to serve nothing or forbidden; or anything else? Or mail.somedomain3.com to load the usermin page? For all the domains.

Removing the MX and A records in DNS makes no sense to me, of course. That was the stuipidest answer I have ever seen on the web :) to a question. So this will be done only on the Apache side.

It's very confusing for everyone because the searche engines indexed everything from the default website, when in fact it is a different domain. And why the hell are those indexed?

The HTTPS part solved it somehow by removing completely the directives with :443. Of course this is not a solution as someone might need https...