shawn1m / overture

A customized DNS relay server
MIT License
1.79k stars 284 forks source link

dns: buffer size too small #146

Closed goxofy closed 5 years ago

goxofy commented 5 years ago

config.json

{
  "BindAddress": ":53",
  "DebugHTTPAddress": "127.0.0.1:34730",
  "PrimaryDNS": [
    {
      "Name": "HiXNS",
      "Address": "40.73.101.101:53",
      "Protocol": "udp",
      "SOCKS5Address": "",
      "Timeout": 6,
      "EDNSClientSubnet": {
        "Policy": "disable",
        "ExternalIP": "",
        "NoCookie": true
      }
    }
  ],
  "AlternativeDNS": [
    {
      "Name": "OpenDNS",
      "Address": "40.73.101.101:53",
      "Protocol": "udp",
      "SOCKS5Address": "",
      "Timeout": 6,
      "EDNSClientSubnet": {
        "Policy": "disable",
        "ExternalIP": "",
        "NoCookie": true
      }
    }
  ],
  "OnlyPrimaryDNS": true,
  "IPv6UseAlternativeDNS": false,
  "WhenPrimaryDNSAnswerNoneUse": "AlternativeDNS",
  "IPNetworkFile": {
    "Primary": "/opt/overture/ip_network_primary_sample",
    "Alternative": "/opt/overture/ip_network_alternative_sample"
  },
  "DomainFile": {
    "Primary": "/opt/overture/domain_primary_sample",
    "Alternative": "/opt/overture/domain_alternative_sample"
  },
  "HostsFile": "/opt/overture/hosts_sample",
  "MinimumTTL": 0,
  "DomainTTLFile" : "/opt/overture/domain_ttl_sample",
  "CacheSize" : 0,
  "RejectQType": [255]
}

dig直接使用40.73.101.101:53能够正常返回,但是设置到overture上解析某些域名提示

time="2019-04-01 21:48:08" level=debug msg="Question from 10.10.21.36: ;img.linux.net.cn.\tIN\t A"
time="2019-04-01 21:48:08" level=debug msg="Question from 10.10.21.36: ;linux.cn.\tIN\t A"
time="2019-04-01 21:48:08" level=debug msg="Answer from HiXNS: linux.cn.\t60\tIN\tA\t211.157.2.93"
time="2019-04-01 21:48:08" level=debug msg="HiXNS Fail: dns: buffer size too small"
shawn1m commented 5 years ago

我自己使用的 overture 查询 linux.cn img.linux.net.cn 都能正常返回,log 也正常,可以尝试换一些公共 dns 服务器。 上游 dns 库有相关的 issue 可以参考:https://github.com/miekg/dns/issues/214