shawn1m / overture

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

Final matcher #199

Closed zhmin closed 4 years ago

zhmin commented 4 years ago
  1. separate primary matcher from alternative matcher. Old matcher config is used as default matcher name.
  2. add final domain matcher that always match all the rule

There is an example to use it.

Primary dns server match some domain, while alternative dns match others.Then I can set primary DomainFile, and add final matcher for alternative dns.

"DomainFile": {
      "Primary": "./domain_primary_sample",
      "Alternative": "",
      "PrimaryMatcher": "suffix-tree",
      "AlternativeMatcher":  "final"
    }

When dealing with an domain request that is not in primary DomainFile, alternative dns will be choosen without ip match. If there is no final matcher, a dns request must be sent to get its ip. It's meaningless!

shawn1m commented 4 years ago

Merged. Thanks!