Open "System Preferences", then "Network". On the left, select the network interface that is used to connect to the internet. For example, it could be Wi-Fi.
Click on "Advanced" at the bottom right, then go to the "DNS" tab. Click on the plus in the left column and enter the DNS record.
Popular DNS server options:
- Cloudflare DNS: 18.104.22.168
- Google Public DNS: 22.214.171.124 and 126.96.36.199
- OpenDNS: 188.8.131.52 and 184.108.40.206
To save, click OK, Apply.
Write to support