added switchdns function