Reads and writes hosts.json