It was your domainname that lead to this solution. Nobody can see what is wrong in a configuration if no one knows what to look for, and an ip address and domain name is vital to lookup a reverse dns configuration.
Having your ip address and/or domain name on a forum is never the cause of you getting targeted by spammers. Having a domain name and a server will be the cause of that.
After all, an ip address and a domain are always publicly known. You make them public your self the moment you startup the server, that’s the whole point of the internet.
Then it is up to you to have enough knowledge to properly secure the server. Having a server without a basic understanding of server administration knowledge is an open invitation to any spammer/script kiddy out there.
regards
Jan