Extract IP and domain name writing to common file