I have one particular VPS that I manage that has been going down a lot recently. Checking the logs, it’s constantly getting bombarded with hack attempts.
Weirdly, all of those hack attempts were going to one specific virtual host on the server: the first one alphabetically. I took a closer look, and the requests weren’t even for that site. They were for a domain that hasn’t existed on this server in ages. But with the way I have Apache’s virtual hosts configured (or, maybe it’s the default behavior), when a request comes in for a domain that is not explicitly configured on the server, it just gets handed to the “first” site.
I realized that the problem here was that I still had wildcard DNS configured on a particular domain, pointed at this server’s IP address. And a lot of the requests were actually coming from some random site that is now running on Squarespace, for someone who was very briefly a client of mine over a decade ago.
Well, I had been hosting some fonts for them, using a special subdomain of the same TLD. That subdomain no longer exists, so the wildcard DNS was kicking in. And for some reason that person still has a stylesheet tag on their Squarespace site, that’s linking back to that long-gone special subdomain.
One thing leads to the next, and every time that site was getting any traffic, it was sending a pointless request for this nonexistent stylesheet, to a nonexistent subdomain. But my wildcard DNS was routing those requests to this particular VPS, and since the site being requested doesn’t exist, the requests were getting handed off to the alphabetically first virtual host that is on the server.
Yeesh.
The moral of the story is: don’t use wildcard DNS unless you have a good reason. And audit your DNS zone files when you have a chance.