Xuanwo / atomdns

2 stars 1 forks source link

Rule to match top-level-domains (TLDs) #1

Open x1angli opened 3 years ago

x1angli commented 3 years ago

Hello

I have a domain list that contains a top-level-domain (TLD) .cn

that is to say

my config file looks like

match "to_mainland" {
  type = "in_domain_list"
  path = "/etc/atomdns/cndomains.txt"
}

and that cndomains.txt contains

.cn
sohu.com
163.com

I want all .cn DNS queries got picked up by this rule and then these queries will be sent to domestic DNS resolvers for faster speed

However, it seems all .cn queries, e.g. sina.com.cn, are NOT recognized, and AtomDNS fallsback to default rule

  1. Did I put it correctly? is .cn correct syntax?
  2. If there is no way to match wildcard *.cn, would you add such feature?

thanks

Xuanwo commented 3 years ago

Neither .cn nor cn is a valid FQDN here, let me check it out.

x1angli commented 3 years ago

Thank you very much for the quick response

FYI: I just changed .cn to cn and it works,

but I am afraid it may not work as expected, coz I just intend to match *.cn only, and I would like **cn**.com stay NOT matched. With the cn, it may disrupt things

Therefore, I would highly appreciate if you can provide an "official" solution to this . thank you in advance

Additional note we may not adhere so strictly to FQDN, as "FQ" stands for fully qualified.

Per the definition https://techterms.com/definition/fqdn, most rules in AtonDNS are already NOT FQDN, since they have two components missing 1. the hostname 2. the trailing dot "." Given that we've already deviated from "FQDN", it's meaningless to comply with "FQDN" anymore. Being flexible to support TLDs would give us an easier time.

Thanks