Hola!
Al final he podido solucionarlo, con un bucle dentro de otro bucle, tal que así:
Código Python:
Ver originaluniq_ips = list(set(ips))
with open("massivenslookup_result.log", "r") as logfile:
content = logfile.readlines()
for ip in uniq_ips:
print("[+] Domains hosted in this IP \'" + ip + "\': ")
filtered_ips = filter(lambda item: ip in item , content)
for domain_same_ip in filtered_ips:
domain_same_ip = domain_same_ip.replace("\n","")
domain_same_ip = domain_same_ip.split(" ")
print(domain_same_ip[0])
Un saludo!