DNS Roaming is a free software changes open source DNS for Windows for automatic rule-based DNS switching. The app can change DNS when it changes network adapter, the network name and when you are assigned a specific IP range.
It runs in the background and waits for the network or IP to change to enforce the rules. Supports popular secure DNS servers such as Cloudflare DNS, Google, Quad9 etc. But you can also add your own custom DNS server.
You can set multiple DNS switching rules and they will work accordingly. It works like service of Windows and offers a simple user interface (UI) through the system tray to change settings.
It even creates log files for DNS client changes or service. You can check the logs at any time and find out which DNS server was running at a certain time.
You can download it software from here. Install and then you will find its icon in the system tray. With a right click on it you will see all the available options.