Updated on 2020-05-03

V2Ray

{
  "inbound": {
    "port": 1080,
    "listen": "127.0.0.1",
    "protocol": "socks"
  },
  "outbound": {
    "protocol": "freedom",
    "settings": {
        "domainStrategy": "UseIPv4"
    }
  },
  "dns": {
    "queryStrategy": "UseIPv4",
    "disableCache": false,
    "servers": [
      "https://9.9.9.9/dns-query"
    ]
  }
}

Clash

dns:
    enable: true
    default-nameserver:
        - 8.8.8.8
    nameserver:
        - https://9.9.9.9/dns-query
curl 'https://www.google.com' -Ivx socks5h://127.0.0.1:1080

CoreDNS

Corefile

. {
    forward . tls://223.5.5.5 tls://223.6.6.6 {
        tls_servername dns.alidns.com
    }
    log
    errors
    cache
}
nslookup google.com 127.0.0.1

Reference