daeuniverse / dae

eBPF-based Linux high-performance transparent proxy solution.
GNU Affero General Public License v3.0
3.14k stars 194 forks source link

[Enhancement] DNS name can't be started with number #602

Open Gaojianli opened 2 months ago

Gaojianli commented 2 months ago

Improvement Suggestion

Not Work:

    upstream {
        # Value can be scheme://host:port, where the scheme can be tcp/udp/tcp+udp.
        # If host is a domain and has both IPv4 and IPv6 record, dae will automatically choose
        # IPv4 or IPv6 to use according to group policy (such as min latency policy).
        # Please make sure DNS traffic will go through and be forwarded by dae, which is REQUIRED for domain routing.
        # If dial_mode is "ip", the upstream DNS answer SHOULD NOT be polluted, so domestic public DNS is not recommended.

        114dns:'udp://114.114.114.114:53'
        googledns:'tcp+udp://dns.google.com:53'
    }

Which will got:

# dae validate -c config.dae 
failed to parse config file config.dae:
line 136:14         114dns:'udp://114.114.114.114:53'
                          ^: mismatched input ':' expecting '}'

Worked:

 upstream {
        # Value can be scheme://host:port, where the scheme can be tcp/udp/tcp+udp.
        # If host is a domain and has both IPv4 and IPv6 record, dae will automatically choose
        # IPv4 or IPv6 to use according to group policy (such as min latency policy).
        # Please make sure DNS traffic will go through and be forwarded by dae, which is REQUIRED for domain routing.
        # If dial_mode is "ip", the upstream DNS answer SHOULD NOT be polluted, so domestic public DNS is not recommended.

        dns114:'udp://114.114.114.114:53'
        googledns:'tcp+udp://dns.google.com:53'
    }

Potential Benefits

To support more number dns name like 114

dae-prow[bot] commented 2 months ago

Thanks for opening this issue!

mzz2017 commented 2 months ago

@Gaojianli 这是符合预期的,约定俗成,不会支持数字开头的变量

mzz2017 commented 2 months ago

@Gaojianli 支持数字开头的变量会给 parser 增加很多挑战和约束

Gaojianli commented 2 months ago

@Gaojianli 支持数字开头的变量会给 parser 增加很多挑战和约束

大部分编程语言确实是这样的,但是对于dns这里,dns名称是个数字的情况还挺多的,算个特殊情况。另外文档似乎没有提到不允许,这里也应该完善一下?