The easiest way to set Quad9 on your entire network is via your router settings. If you'd prefer to set Quad9 on a single system, please follow the steps below to configure macOS to use Quad9.
Open the Apple menu > System Preferences, then select Network.
Click Advanced and then select the DNS tab. From the DNS tab, select the "+" symbol.
Note: If you have any other DNS providers configured, you will want to first select their servers and then select the "-" symbol to remove them before adding our service.
Enter the Quad9 IP addresses of your preferred service and select OK.
If your network/computer support IPv6, it's also recommended to configure the Quad9 IPv6 addresses. If you're not sure if IPv6 is configured on your network, you can test that here: https://test-ipv6.com/
Select Apply. You are now using Quad9.