Yes it can be done, but why are you not using DHCP to alter the DNS settings once the client is set to use a DHCP server?
 
Al_Po recently posted a UDF to enable DHCP


EnableDHCP() - Configures a NIC to use DHCP settings