2

I know how you can change the DNS settings for a particular network adapter from Network and Sharing Center.

The problem I'm facing is that each time I connect my phone(s) over USB to use the tethered internet connection, they show up as a new adapter with a random name.

How can I configure Windows to use the same DNS settings for all network adapters?

The ideal solution would be a setting/script that needs to be configured/run only once, and not each time I tether.

undo
  • 6,129

1 Answers1

3

A PowerShell command to reset the DNS server on all adapters is:

Get-NetAdapter | set-DnsClientServerAddress -ServerAddresses ("8.8.8.8","1.1.1.1")

You may put the command inside a PowerShell .ps1 script and either run it manually or even schedule it to run automatically whenever a new network connection is detected.

For the latter, see the post How to launch a command on network connection/disconnection for instructions on using the Task Scheduler for creating a trigger that runs this script when a connection is detected.

This trigger will run upon connecting to all networks, but it is always possible to refine it.

harrymc
  • 498,455