bug in update_dns with keys, but otherwise general improvements