Routing you can maintain, with rule providers
Thousands of copied DOMAIN-SUFFIX lines go stale in months. Three self-updating rule sets leave you with five lines.
Published , about 4 min

Many profiles run to ten thousand lines, nine tenths of them rules. They worked when copied, then sites changed domains and nobody dared delete anything. Rule providers fix that: someone else maintains the list and your profile only says where to get it.
Nothing advanced: rules go out of date and you do not want to edit daily. Leave it to those who keep lists, and keep only your own few.
The finished thing
Three sets, for Chinese domains, Chinese IPs and ads:
rule-providers:
cn_domain:
type: http
behavior: domain
format: mrs
interval: 86400
url: https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo/geosite/cn.mrs
cn_ip:
type: http
behavior: ipcidr
format: mrs
interval: 86400
url: https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo/geoip/cn.mrs
ads:
type: http
behavior: domain
format: mrs
interval: 86400
url: https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo/geosite/category-ads-all.mrsAnd five rules:
rules:
- IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
- RULE-SET,ads,REJECT
- RULE-SET,cn_domain,DIRECT
- RULE-SET,cn_ip,DIRECT,no-resolve
- MATCH,PROXYReplace PROXY with your group's exact name. Outside China, use your own country's IP file, such as geo/geoip/jp.mrs, and drop the domain set if there isn't one for you.
What each line does
- type: httpDownload from an address.
filemeans a local file - behavior: domainOnly domains inside.
ipcidrmeans only ranges,classicala mix - format: mrsmihomo's binary format, small and quick to load. The Chinese domain list is just 520 KB
- interval: 86400Update every 86400 seconds, once a day
- urlThe file. These come from meta-rules-dat by MetaCubeX
A wrong behavior is the usual mistake. Give a domain file ipcidr and the set fails to load while later rules keep working, so nothing looks broken and sites meant to go direct all use the proxy.
Why this order
Local addresses first, so your printer and router don't go abroad. Ads second, to stop them early. Domains before IPs, since matching a domain needs no lookup. no-resolve after cn_ip keeps it to requests that are already IPs. MATCH catches the rest.
Into FlClash
Don't edit the subscription file, because the next update wipes it. Put both blocks in the profile's override, with your rules ahead of the subscription's, for reasons discussed in 2251.
The sets are downloaded from GitHub the first time. If you aren't connected yet that may stall, so connect with the subscription's own rules first.
More branches
For streaming or AI sites, repeat the pattern: one more set, one more RULE-SET, pointing to a new group. The geo/geosite folder of meta-rules-dat is sorted by site, and the file name is the name.
Don't overdo it. Each addition means checking whether it overlaps the earlier ones. Three to five is plenty for most people.

Test the change
Misspelled rules and missing groups show up at once in the Profile checker. To see where a domain stops, use the Rule tester, which can't look inside rule sets and marks them unknown.
Moving from a bloated file
- Back up.
- Count
DOMAIN-SUFFIX; hundreds were copied from somewhere. - Keep your own, usually under twenty.
- Replace the rest with the three sets and five rules above.
- Yours on top.
- Use it a week.
From ten thousand lines to sixty, quicker and lighter.
Groups for sites
proxy-groups:
- name: Video
type: select
include-all: true
filter: "(?i)HK|JP|SG"
- name: AI
type: select
include-all: true
filter: "(?i)US"
rule-providers:
openai:
type: http
behavior: domain
format: mrs
interval: 86400
url: https://github.com/MetaCubeX/meta-rules-dat/raw/refs/heads/meta/geo/geosite/openai.mrs
rules:
- RULE-SET,openai,AIinclude-all takes all nodes, filter selects by name without regard to case. Common sets: openai, youtube, netflix, telegram, github, google, apple, microsoft, steam.
Three behaviours
| Contents | behavior | Example |
|---|---|---|
| Domains | domain | +.example.com |
| Ranges | ipcidr | 1.1.1.0/24 |
| Whole rules | classical | DOMAIN-SUFFIX,example.com |
mrs supports the first two. Errors show in the log under provider.
Your own
- FileOne domain a line, txt
- Declare
type: file,behavior: domain,format: text - Use
RULE-SET,name,DIRECT - Several devicesIn your Git as
type: http
It does not download
Connect with the old rules first; add proxy: group to the provider; or use a mirror. Afterwards it is cached.
How often
A day. Minutes waste traffic, a year is never. If something is wrong one day, see whether the list just changed.
Also asked
How is this different from geosite?
GEOSITE,cn reads one big data file with everything in it. A rule set downloads only what you ask for, uses less memory and updates on its own schedule.
Can ad rules break sites?
Yes. Some login buttons sit on a blocked domain. If something won't open, look for REJECT on the Requests page.
Do many sets slow it?
domain and ipcidr are quick at tens of thousands; classical is not.
Overlaps?
The earlier wins.
What is inside?
mrs is binary; the same folder has list and yaml.
Read next
Using itSend the terminal, Git, Docker and WSL through FlClashThe browser works but git clone hangs. Every tool reads its proxy from a different place. Here they all are.
Using it46 ms of delay and the video still buffersThe test page is all green and 4K still stalls. Delay and bandwidth are different, and there are a few causes people rarely mention.
How it worksHysteria2, TUIC and Reality: what's the differenceHalf your nodes say hy2, half say reality. Choose by your network. No cryptography needed.