google search console – Several domains on a site indexing problem

I have a site with several domains pointed to it as aliases. For example:
abc.com (main domain)
def.com
ghi.com

All are directed to the same server, so everything on abc.com also appears on def.com & ghi.com. The problem is that google indexes def.com & ghi.com and not the main domain I'm thinking about.

Can any one learn what to do for this problem?