DNS Roaming is a free open source DNS change software for Windows for automatic rule-based DNS switching. The application may change DNS when the network adapter, the network name, and you are given 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 many DNS switching rules and they will work accordingly. It works as a Windows service and offers a simple user interface (UI) through the system tray to change settings.
It even creates log files for DNS client or service changes. You can check the logs at any time and find out which DNS server was running at a particular 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.