refactor pdnsOut