shawn1m / overture

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

IP network list, Domain matcher is nil导致 #224

Closed yquan closed 4 years ago

yquan commented 4 years ago

版本 1.6.1

查询jd.com,结果最后用了alternative DNS

time="2020-04-01 13:23:42" level=debug msg="Question from 127.0.0.1: ;jd.com.\tIN\t A"
time="2020-04-01 13:23:42" level=debug msg="Domain matcher is nil, not checking"
time="2020-04-01 13:23:42" level=debug msg="Domain matcher is nil, not checking"
time="2020-04-01 13:23:42" level=debug msg="Creating new connection to 119.29.29.29:53"
time="2020-04-01 13:23:42" level=debug msg="Answer from DNSPod: jd.com.\t66\tIN\tA\t111.13.149.108"
time="2020-04-01 13:23:42" level=debug msg="Answer from DNSPod: jd.com.\t66\tIN\tA\t120.52.148.118"
time="2020-04-01 13:23:42" level=debug msg="Answer from DNSPod: jd.com.\t66\tIN\tA\t118.193.98.63"
time="2020-04-01 13:23:42" level=debug msg="Try to match response ip address with IP network"
time="2020-04-01 13:23:42" level=debug msg="IP network list is nil, not checking"
time="2020-04-01 13:23:42" level=debug msg="IP network list is nil, not checking"
time="2020-04-01 13:23:42" level=debug msg="Try to match response ip address with IP network"
time="2020-04-01 13:23:42" level=debug msg="IP network list is nil, not checking"
time="2020-04-01 13:23:42" level=debug msg="IP network list is nil, not checking"
time="2020-04-01 13:23:42" level=debug msg="Try to match response ip address with IP network"
time="2020-04-01 13:23:42" level=debug msg="IP network list is nil, not checking"
time="2020-04-01 13:23:42" level=debug msg="IP network list is nil, not checking"
time="2020-04-01 13:23:42" level=debug msg="IP network match failed, finally use alternative DNS"
time="2020-04-01 13:23:42" level=debug msg="Creating new connection to 208.67.222.222:443"
time="2020-04-01 13:23:42" level=debug msg="Answer from OpenDNS: jd.com.\t120\tIN\tA\t111.13.149.108"
time="2020-04-01 13:23:42" level=debug msg="Answer from OpenDNS: jd.com.\t120\tIN\tA\t118.193.98.63"
time="2020-04-01 13:23:42" level=debug msg="Answer from OpenDNS: jd.com.\t120\tIN\tA\t120.52.148.118"

config.json的内容:

  "BindAddress": ":5300",
  "DebugHTTPAddress": "127.0.0.1:5555",
  "PrimaryDNS": [
    {
      "Name": "DNSPod",
      "Address": "119.29.29.29:53",
      "Protocol": "udp",
      "SOCKS5Address": "",
      "Timeout": 6,
      "EDNSClientSubnet": {
        "Policy": "disable",
        "ExternalIP": "",
        "NoCookie": true
      }
    }
  ],
  "AlternativeDNS": [
    {
      "Name": "OpenDNS",
      "Address": "208.67.222.222:443",
      "Protocol": "tcp",
      "SOCKS5Address": "127.0.0.1:1080",
      "Timeout": 6,
      "EDNSClientSubnet": {
        "Policy": "disable",
        "ExternalIP": "",
        "NoCookie": true
      }
    }
  ],
  "OnlyPrimaryDNS": false,
  "IPv6UseAlternativeDNS": false,
  "AlternativeDNSConcurrent": false,
  "PoolIdleTimeout": 15,
  "PoolMaxCapacity": 15,
  "WhenPrimaryDNSAnswerNoneUse": "PrimaryDNS",
  "IPNetworkFile": {
    "Primary": "./ip_network_primary_sample",
    "Alternative": "./ip_network_alternative_sample"
  },
  "DomainFile": {
    "Primary": "./domain_primary_sample",
    "Alternative": "./domain_alternative_sample",
    "Matcher":  "full-map"
  },
  "HostsFile": {
    "HostsFile": "./hosts_sample",
    "Finder": "full-map"
  },
  "MinimumTTL": 0,
  "DomainTTLFile" : "./domain_ttl_sample",
  "CacheSize" : 0,
  "RejectQType": [255]
}

ip_network_primary_sample:

127.0.0.9/32

ip_network_alternative_sample:

127.0.0.10/32

照理说应该报的几个nil都有的啊。是我漏了什么嘛?

yquan commented 4 years ago

竟然是因为配置文件里面的相对路径引起的没有读到配置文件里面指定的所有文件,改为绝对路径后一切正常了。