A better way to edit hosts file