QQ群:397745473
323_旁路由设置openwrt加dns的记录.md
准备
1 2 3
| SSR+ADGuard Home下载: https://github.com/AUK9527/Are-u-ok ADGuard Home 过滤器(BlueSkyXN): https://raw.githubusercontent.com/BlueSkyXN/AdGuardHomeRules/master/all.txt
|
操作步骤
1 2 3 4 5 6 7 8 9
| 1. 找到对应的固件下载并安装 https://fw.koolcenter.com/iStoreOS/ 参考安装教程: https://youtu.be/Mj9WLY8-Pdo?t=657
2. 插件安装 下载安装插件 https://github.com/AUK9527/Are-u-ok PassWall2 AdGuardHome MosDNS
|
配置插件
1 2
| 参考教程: https://youtu.be/YUT_egUzcvU?t=361
|
完整配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
| log: level: info file: "/var/log/mosdns.log"
#api: # http: "0.0.0.0:9091"
include: []
plugins: - tag: geosite_cn type: domain_set args: files: - "/var/mosdns/geosite_cn.txt"
- tag: geoip_cn type: ip_set args: files: - "/var/mosdns/geoip_cn.txt"
- tag: geosite_apple type: domain_set args: files: - "/var/mosdns/geosite_apple.txt"
- tag: geosite_no_cn type: domain_set args: files: - "/var/mosdns/geosite_geolocation-!cn.txt"
- tag: whitelist type: domain_set args: files: - "/etc/mosdns/rule/whitelist.txt"
- tag: blocklist type: domain_set args: files: - "/etc/mosdns/rule/blocklist.txt"
- tag: greylist type: domain_set args: files: - "/etc/mosdns/rule/greylist.txt"
- tag: ddnslist type: domain_set args: files: - "/etc/mosdns/rule/ddnslist.txt"
- tag: hosts type: hosts args: files: - "/etc/mosdns/rule/hosts.txt"
- tag: redirect type: redirect args: files: - "/etc/mosdns/rule/redirect.txt"
- tag: adlist type: domain_set args: files: - "/var/disable-ads.txt"
- tag: local_ptr type: domain_set args: files: - "/etc/mosdns/rule/local-ptr.txt"
- tag: cloudflare_cidr type: ip_set args: files: - "/etc/mosdns/rule/cloudflare-cidr.txt"
- tag: lazy_cache type: cache args: size: 8000 lazy_cache_ttl: 86400
- tag: forward_xinfeng_udp type: forward args: concurrent: 2 upstreams: - addr: "114.114.114.114" - addr: "114.114.115.115"
- tag: forward_local type: forward args: concurrent: 2 upstreams: - addr: "119.29.29.29" bootstrap: 119.29.29.29 enable_pipeline: false insecure_skip_verify: false idle_timeout: 30 - addr: "223.5.5.5" bootstrap: 119.29.29.29 enable_pipeline: false insecure_skip_verify: false idle_timeout: 30 - addr: "https://doh.pub/dns-query" bootstrap: 119.29.29.29 enable_pipeline: false insecure_skip_verify: false idle_timeout: 30 - addr: "https://dns.alidns.com/dns-query" bootstrap: 119.29.29.29 enable_pipeline: false insecure_skip_verify: false idle_timeout: 30 enable_http3: true - addr: "https://doh.360.cn/dns-query" bootstrap: 119.29.29.29 enable_pipeline: false insecure_skip_verify: false idle_timeout: 30 - addr: "114.114.115.115" bootstrap: 119.29.29.29 enable_pipeline: false insecure_skip_verify: false idle_timeout: 30
- tag: forward_remote type: forward args: concurrent: 2 upstreams: - addr: "https://8.8.4.4/dns-query" #bootstrap: 119.29.29.29 #enable_pipeline: false #insecure_skip_verify: false socks5: 127.0.0.1:1070 idle_timeout: 30 - addr: "https://1.0.0.1/dns-query" #bootstrap: 119.29.29.29 #enable_pipeline: false #insecure_skip_verify: false socks5: 127.0.0.1:1070 idle_timeout: 30
- tag: forward_remote_upstream type: sequence args: - exec: prefer_ipv4 - exec: $forward_remote
- tag: modify_ttl type: sequence args: - exec: ttl 0-0
- tag: modify_ddns_ttl type: sequence args: - exec: ttl 5-5
- tag: has_resp_sequence type: sequence args: - matches: qname $ddnslist exec: $modify_ddns_ttl - matches: "!qname $ddnslist" exec: $modify_ttl - matches: "resp_ip $cloudflare_cidr" exec: black_hole - matches: has_resp exec: accept
- tag: query_is_non_local_ip type: sequence args: - exec: $forward_local - matches: "!resp_ip $geoip_cn" exec: drop_resp
- tag: fallback type: fallback args: primary: forward_remote_upstream secondary: forward_remote_upstream threshold: 500 always_standby: true
- tag: apple_domain_fallback type: fallback args: primary: query_is_non_local_ip secondary: forward_xinfeng_udp threshold: 100 always_standby: true
- tag: query_is_apple_domain type: sequence args: - matches: "!qname $geosite_apple" exec: return - exec: $apple_domain_fallback
- tag: query_is_ddns_domain type: sequence args: - matches: qname $ddnslist exec: $forward_local
- tag: query_is_local_domain type: sequence args: - matches: qname $geosite_cn exec: $forward_local
- tag: query_is_no_local_domain type: sequence args: - matches: qname $geosite_no_cn exec: $forward_remote_upstream
- tag: query_is_whitelist_domain type: sequence args: - matches: qname $whitelist exec: $forward_local
- tag: query_is_greylist_domain type: sequence args: - matches: qname $greylist exec: $forward_remote_upstream
- tag: query_is_reject_domain type: sequence args: - matches: qname $blocklist exec: reject 3 - matches: qname $adlist exec: reject 3 - matches: - qtype 12 - qname $local_ptr exec: reject 3 - matches: qtype 65 exec: reject 3
- tag: main_sequence type: sequence args: - exec: $hosts - exec: jump has_resp_sequence - matches: - "!qname $ddnslist" - "!qname $blocklist" - "!qname $adlist" - "!qname $local_ptr" exec: $lazy_cache - exec: $redirect - exec: jump has_resp_sequence - exec: $query_is_apple_domain - exec: jump has_resp_sequence - exec: $query_is_ddns_domain - exec: jump has_resp_sequence - exec: $query_is_whitelist_domain - exec: jump has_resp_sequence - exec: $query_is_reject_domain - exec: jump has_resp_sequence - exec: $query_is_greylist_domain - exec: jump has_resp_sequence - exec: $query_is_local_domain - exec: jump has_resp_sequence - exec: $query_is_no_local_domain - exec: jump has_resp_sequence - exec: $fallback
- tag: udp_server type: udp_server args: entry: main_sequence listen: ":5335"
- tag: tcp_server type: tcp_server args: entry: main_sequence listen: ":5335"
|
QQ群:397745473