Prevent Nonexistent Subdomains from Displaying Content of Main Domain
Hello,
I have cPanel installed on a VPS. The DNS for all of the domains on said server is managed via my hosting company's DNS portal. From what I understand, it's usually recommended to have cPanel manage DNS, however, my provider has said it's more reliable that they handle it instead, so I've just kept it that way.
To create subdomains though, a wildcard record has had to be used which I'm pretty sure is what might be causing part of the issue. That issue is that any nonexistent subdomains will display the contents of the main domain on the server. Google has cached a bunch of these duplicate pages served through these "phantom" subdomains and I'd like to stop it.
Is it possible to just have cPanel throw a server-wide 404 for nonexistent subdomains? Would switching over to cPanel managing DNS fix this entirely (as a wildcard record should no longer be required?).
Thanks!
-
Drop the wildcard and any anytime you create a subdomain add the appropriate record to your DNS zone at your hosting company.
2 -
Thanks, Damian! Seems like a simple solution that would provide the best of both worlds.
0
Please sign in to leave a comment.
Comments
2 comments