From b5a5478cb2c40f5ca9c3760fa712c59db4c479b6 Mon Sep 17 00:00:00 2001 From: picopock <95534779+picopock@users.noreply.github.com> Date: Thu, 16 Mar 2023 23:03:14 +0800 Subject: [PATCH] feat: add ddns config (#1) --- README.md | 1 + mosdnsv5/config.yaml | 12 ++++++++++-- mosdnsv5/custom_rules/ddns.txt | 0 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 mosdnsv5/custom_rules/ddns.txt diff --git a/README.md b/README.md index d7ea8b1..a47a933 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ Mosdns config and auto update shell script. ├── config.yaml # main config ├── custom_rules # user custon rule, has higher priority │   ├── block.txt # block rule +│   ├── ddns.txt # ddns rule, not cache if match │   ├── direct.txt # forward local rule │   ├── host.txt # host rule │   ├── proxy.txt # forward remote rule diff --git a/mosdnsv5/config.yaml b/mosdnsv5/config.yaml index bc6f630..08bc0d0 100755 --- a/mosdnsv5/config.yaml +++ b/mosdnsv5/config.yaml @@ -1,5 +1,5 @@ log: - level: debug # 日志级别。可选 "debug" "info" "warn" "error"。默认 "info"。 + level: info # 日志级别。可选 "debug" "info" "warn" "error"。默认 "info"。 file: '' # 记录日志到文件。默认输出至 stderr。 production: true # 纯 json 输出。 @@ -12,6 +12,14 @@ api: include: [] plugins: + - tag: ddns_domain + type: domain_set + args: + # exps: # 域名表达式。 + # - "qq.com" + files: + - ./custom_rules/ddns.txt + - tag: direct_domain type: domain_set args: @@ -129,7 +137,7 @@ plugins: # - exec: prefer_ipv4 - matches: - - '!qname ddns.doamin.com' + - '!qname $ddns_domain' exec: $mem_cache - matches: - has_resp diff --git a/mosdnsv5/custom_rules/ddns.txt b/mosdnsv5/custom_rules/ddns.txt new file mode 100644 index 0000000..e69de29