save hostnames in json file