Update so that localhost entries don't get deleted when the hostname gets added to the 127.0.0.1 line. Closes #6202