How to remove duplicate domains but treat subdomains as different domains?

I have a list of 1000 urls like

ebay.com/iue
ebay.com/aieruf
cnn.com/asdfh
subs.ebay.com/sdfhsdf
cnn.com/ahjdf

I want to remove all duplicate domains. This is possible to do using scrapebox. But the problem is, I want to keep all unique subdomains. meaning I want to treat subdomains as unique domains. for example, in the above list out of
ebay.com/iue
ebay.com/aieruf
subs.ebay.com/sdfhsdf

one of the first 2 would remain, the other one would be removed. the third one would remain.

How…

How to remove duplicate domains but treat subdomains as different domains?