Installing nscrypt-proxy is a commonly used method, the specific installation steps are as follows (using a Mac computer as an example)
# Installation
brew install dnscrypt-proxy
# Modify configuration, set log path
vim /opt/homebrew/etc/dnscrypt-proxy.toml
# Find the following four items, and change to
listen_addresses = ['[::]:53']
log_level = 0
log_file = '/usr/local/log/dnscrypt-proxy.log'
ignore_system_dns = true
# Add or remove according to your needs
server_names = ['google', 'google-ipv6']
# Start
sudo brew services run dnscrypt-proxy
Find your computer network settings and change the DNS settings to 127.0.0.1
, because after setting this way, the requests for accessing DNS will be encrypted