sing-box icon indicating copy to clipboard operation
sing-box copied to clipboard

Domain rules not honored for domains with CNAME

Open blip opened this issue 1 year ago • 0 comments

Operating system

Linux

System version

5

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

No response

Version

No response

Description

If a rule like { "domain_suffix": "bbc.co.uk" } exists, visiting www.bbc.co.uk should have that rule matched. But because www.bbc.co.uk currently ultimately CNAME to bbc.map.fastly.net, a different rule is matched. This makes domain based rules almost unusable:

  1. Whether a domain matches not only depends on the domain itself, but also if it has CNAME configured which users have no control over.
  2. I can manually add bbc.map.fastly.net, but there is no garantee bbc.co.uk always CNAME to it, and if abc.com also CNAME to it, there is no way for the two domains to match different rules.

I wonder if this is by design? Maybe I didn't configure it right? How to solve the "two domains CNAME to the same domain but different rules should be matched" issue?

Thanks.

Reproduction

N/A

Logs

No response

Supporter

Integrity requirements

  • [X] I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • [X] I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • [X] I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • [X] I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.

blip avatar Oct 20 '24 16:10 blip