fix DNS over IPv6 bug and remove some unused variables