routedns icon indicating copy to clipboard operation
routedns copied to clipboard

Feature Request: support upstream routing using geosite.dat

Open luochen1990 opened this issue 8 months ago • 3 comments

https://github.com/v2fly/domain-list-community

luochen1990 avatar Apr 23 '25 12:04 luochen1990

I'm not very familiar with it. Can you describe how you think it should work? Like a dedicated router, or adding it as a blocklist? Automatic updates?

folbricht avatar Apr 24 '25 06:04 folbricht

It works like:

  1. The geosite.dat file path can be specified from configuration, like geodata_path: /path/to/geosite.dat
  2. The file will be loaded into RAM at runtime, and the protobuf encoded binary data will be decoded and prepared for matching.
  3. So we can reference it in the routing rules like geosite:private -> upstream1, which means the query that contained in geosite:private will be route to upstream1

Automatic updates will be better, but not the most important feature, update between restart is also acceptable.

luochen1990 avatar Apr 24 '25 11:04 luochen1990

I looked at the file, trying to understand how to interpret the data in it. In your example, what is geosite:private? For example, one entry in dlc.dat looks like this:

{
  "countryCode":  "YOUTUBE",
  "domain":  [
    {
      "type":  "RootDomain",
      "value":  "youtube"
    },
    {
      "type":  "RootDomain",
      "value":  "ggpht.cn",
      "attribute":  [
        {
          "key":  "cn",
          "boolValue":  true
        }
      ]
    },
    {
      "type":  "RootDomain",
      "value":  "ggpht.com"
    },
    {
      "type":  "RootDomain",
      "value":  "googlevideo.com"
    },

Do you expect to route on the value of countryCode? Or when there's an attribute present?

folbricht avatar Apr 26 '25 18:04 folbricht