ChinaDNS 的上游 DNS 分为 国内 DNS 和 可信 DNS。
- ChinaDNS 会同时向上游的 DNS 发送请求。
- 如果
可信 DNS先返回,则直接采用可信 DNS的结果。 - 如果
国内 DNS先返回,分两种情况:如果返回的结果是国内的 IP, 则采用;否则丢弃并转而采用可信 DNS的结果。
| package main | |
| import ( | |
| "flag" | |
| "io" | |
| "log" | |
| "net" | |
| "net/http" | |
| "os" | |
| "strings" |
| #EXTM3U x-tvg-url="https://tv.mxdyeah.top/epgphp/t.xml.gz" | |
| #EXTINF:-1 tvg-id="CCTV1" tvg-name="CCTV1" tvg-logo="https://upload.112114.xyz/logo/CCTV1.png" group-title="央视",CCTV-1 | |
| rtp://239.253.64.120:5140/?fcc=10.255.75.73:15970 | |
| #EXTINF:-1 tvg-id="CCTV2" tvg-name="CCTV2" tvg-logo="https://upload.112114.xyz/logo/CCTV2.png" group-title="央视",CCTV-2 | |
| rtp://239.253.64.195:5140/?fcc=10.255.75.73:15970 | |
| #EXTINF:-1 tvg-id="CCTV3" tvg-name="CCTV3" tvg-logo="https://upload.112114.xyz/logo/CCTV3.png" group-title="央视",CCTV-3 | |
| rtp://239.253.64.244:5140/?fcc=10.255.75.73:15970 | |
| #EXTINF:-1 tvg-id="CCTV4" tvg-name="CCTV4" tvg-logo="https://upload.112114.xyz/logo/CCTV4.png" group-title="央视",CCTV-4 | |
| rtp://239.253.64.196:5140/?fcc=10.255.75.73:15970 |
| using Microsoft.CodeAnalysis.CSharp; | |
| using Microsoft.CodeAnalysis.CSharp.Scripting; | |
| using Microsoft.CodeAnalysis.Scripting; | |
| using Mono.CSharp; | |
| using System; | |
| using System.CodeDom.Compiler; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Dynamic; | |
| using System.Linq; |
| $ LD_PRELOAD=$PWD/sendmsg.so dig twitter.com @8.8.8.8 | |
| ;; Warning: Message parser reports malformed message packet. <-- malformed 因为把压缩指针当作域名一部分了 | |
| ;; Question section mismatch: got twitter.com/RESERVED0/CLASS256 | |
| ; <<>> DiG 9.9.5-3-Ubuntu <<>> twitter.com @8.8.8.8 | |
| ;; global options: +cmd | |
| ;; Got answer: | |
| ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44722 | |
| ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1 |
| -480p - Run tenfoot in 480p rather than 1080p | |
| -720p - Run tenfoot in 720p rather than 1080p | |
| -accesscode - | |
| -all_languages - show longest loc string from any language | |
| -batterytestmode - rapidly cycle battery percentages for testing | |
| -bigpicture - Start in Steam Big Picture mode | |
| -blefw - | |
| -cafeapplaunch - Launch apps in a cyber cafe context | |
| -candidates - Show libjingle candidates for local connection as they are processed | |
| -ccsyntax - Spew details about the localized strings we load |