I had a series of domains that redirected to a main domain (let's call it A) where the website is located. One of them is no longer owned by me, and a few hours after being removed from the previous provider it was purchased by someone else and currently redirects to malicious sites.
The problem lies in the fact that Google is still indexing this old domain (let's call it B). In fact doing a search on google site:(url of B) some of the results still redirect to pages of the main site A.
I was wondering if it would be possible to remove the indexing of B from google in some way and if for the current situation there could be any penalties in the google ranking of the main site.