

Yes, if you’ve built the network from scratch that works. Retrofitting it into an existing network however is a massive piece of work when you don’t have that single source of truth to start with however. On networks I’ve built sensibly, I’ll happily give people whatever CNAME they want to refer to their machine, but the machines actual name is descriptive, not the other way round.
The ultimate bad bot blocker (https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker) does the heavy lifting for me, it updates multiple times per day to add and remove IP addreses and bot referers. It does need some monitoring though, some of the rules wildcard a bit hard and will catch mastadon servers with unusual names for example.