fix dns logic