{"id":117881,"date":"2026-10-25T19:32:22","date_gmt":"2026-10-25T11:32:22","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/117881.html"},"modified":"2026-10-25T19:32:22","modified_gmt":"2026-10-25T11:32:22","slug":"coredns-nsid-%e6%8f%92%e4%bb%b6%e5%85%a8%e8%a7%a3%e6%9e%90%ef%bc%9a%e5%9f%ba%e4%ba%8e-rfc-5001-%e7%9a%84-dns-%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%a0%87%e8%af%86%e6%9c%ba%e5%88%b6%e4%b8%8e-cloudpods","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/117881.html","title":{"rendered":"CoreDNS nsid \u63d2\u4ef6\u5168\u89e3\u6790\uff1a\u57fa\u4e8e RFC 5001 \u7684 DNS \u670d\u52a1\u5668\u6807\u8bc6\u673a\u5236\u4e0e Cloudpods \u96c6\u6210\u5b9e\u8df5"},"content":{"rendered":"<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u540e\u7aef<\/span><\/li>\n<li><span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><\/li>\n<li><span class=\"gcb-tag\">\u8fd0\u7ef4<\/span><\/li>\n<li><span class=\"gcb-tag\">\u865a\u62df\u5316<\/span><\/li>\n<li><span class=\"gcb-tag\">\u4eba\u5de5\u667a\u80fd<\/span><\/li>\n<li><span class=\"gcb-tag\">AI \u5e94\u7528<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011cloudpods<\/h3>\n<p class=\"gcb-project-desc\">\u5f00\u6e90\u3001\u4e91\u539f\u751f\u7684\u591a\u4e91\u7ba1\u7406\u53ca\u6df7\u5408\u4e91\u878d\u5408\u5e73\u53f0<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/yunionio\/cloudpods<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h3>\u5bfc\u8bfb<\/h3>\n<p>nsid \u662f CoreDNS \u4e2d\u4e00\u4e2a\u8f7b\u91cf\u4f46\u6781\u5177\u5b9e\u6218\u4ef7\u503c\u7684\u63d2\u4ef6&#xff1a;\u5b83\u5b9e\u73b0 RFC 5001 \u534f\u8bae&#xff0c;\u5728 DNS \u5e94\u7b54\u4e2d\u6ce8\u5165\u4e00\u4e2a EDNS0 OPT \u8d44\u6e90\u8bb0\u5f55&#xff0c;\u7528\u6765\u552f\u4e00\u6807\u8bc6&#034;\u662f\u54ea\u4e00\u53f0\u670d\u52a1\u5668\u751f\u6210\u4e86\u8fd9\u6761\u5e94\u7b54&#034;\u3002\u5728 anycast \u96c6\u7fa4\u3001\u591a\u5b9e\u4f8b\u90e8\u7f72\u4e0e\u6545\u969c\u6392\u67e5\u573a\u666f\u4e2d&#xff0c;\u5b83\u80fd\u8ba9\u8fd0\u7ef4\u4eba\u5458\u4e00\u773c\u5b9a\u4f4d\u5e94\u7b54\u6765\u6e90&#xff0c;\u800c\u65e0\u9700\u9010\u4e00\u767b\u5f55\u670d\u52a1\u5668\u6838\u5bf9\u3002\u672c\u6587\u4ee5 Cloudpods \u4ed3\u5e93\u5185 vendor \u7684 CoreDNS v1.10.1&#xff08;\u89c1 go.mod&#xff09;\u4e2d\u7684 nsid \u63d2\u4ef6\u6587\u6863\u4e3a\u4e3b\u4f53&#xff0c;\u7ed3\u5408\u63d2\u4ef6\u6e90\u7801\u3001\u534f\u8bae\u5c42\u5b9e\u73b0\u4e0e\u4ed3\u5e93\u5185 DNS \u670d\u52a1\u96c6\u6210\u65b9\u5f0f&#xff0c;\u5b8c\u6574\u8bb2\u89e3\u5176\u8bed\u6cd5\u3001\u914d\u7f6e\u3001\u5e95\u5c42\u539f\u7406\u4e0e\u5ba2\u6237\u7aef\u9a8c\u8bc1\u65b9\u6cd5\u3002<\/p>\n<h3>nsid \u662f\u4ec0\u4e48&#xff1a;RFC 5001 \u4e0e EDNS0 NSID \u9009\u9879<\/h3>\n<p>nsid&#xff08;Nameserver Identifier&#xff09;\u63d2\u4ef6\u7684\u6838\u5fc3\u804c\u8d23\u662f&#xff1a;\u4e3a\u6bcf\u4e00\u6761 DNS \u5e94\u7b54\u9644\u52a0\u4e00\u4e2a\u6807\u8bc6\u670d\u52a1\u5668\u8eab\u4efd\u7684 EDNS0 OPT \u8bb0\u5f55\u3002\u5b83\u5b9e\u73b0\u7684\u662f RFC 5001 \u5b9a\u4e49\u7684 NSID \u534f\u8bae\u3002<\/p>\n<p>\u8981\u7406\u89e3\u5b83\u7684\u4ef7\u503c&#xff0c;\u9700\u8981\u5148\u4e86\u89e3 DNS \u534f\u8bae\u7684\u4e24\u4e2a\u57fa\u7840\u6982\u5ff5&#xff1a;<\/p>\n<ul>\n<li>EDNS0&#xff08;RFC 6891&#xff09;&#xff1a;DNS \u534f\u8bae\u7684\u6269\u5c55\u673a\u5236&#xff0c;\u901a\u8fc7 OPT \u4f2a\u8d44\u6e90\u8bb0\u5f55&#xff08;Type OPT&#xff09;\u643a\u5e26\u989d\u5916\u53c2\u6570\u3002\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u901a\u8fc7 OPT \u8bb0\u5f55\u534f\u5546 UDP \u62a5\u6587\u5927\u5c0f\u3001DNSSEC \u652f\u6301\u7b49\u80fd\u529b\u3002<\/li>\n<li>NSID \u9009\u9879&#xff08;RFC 5001&#xff09;&#xff1a;EDNS0 \u7684\u4e00\u4e2a\u4e13\u7528\u9009\u9879&#xff0c;\u9009\u9879\u7801\u4e3a 0x3&#xff0c;\u7528\u4e8e\u5728\u5e94\u7b54\u4e2d\u643a\u5e26\u4e00\u4e2a&#034;\u540d\u79f0\u670d\u52a1\u5668\u6807\u8bc6\u7b26&#034;&#xff0c;\u8ba9\u5ba2\u6237\u7aef\u80fd\u591f\u8bc6\u522b\u5e94\u7b54\u7a76\u7adf\u6765\u81ea\u54ea\u4e00\u53f0\u670d\u52a1\u5668\u3002<\/li>\n<\/ul>\n<p>\u5728\u534f\u8bae\u5b9e\u73b0\u5c42\u9762&#xff0c;vendor\/github.com\/miekg\/dns\/edns.go \u4e2d\u5b9a\u4e49\u4e86\u5bf9\u5e94\u7684\u6570\u636e\u7ed3\u6784&#xff1a;<\/p>\n<p>\/\/ EDNS0_NSID option is used to retrieve a nameserver<br \/>\n\/\/ identifier. When sending a request Nsid must be set to the empty string<br \/>\n\/\/ The identifier is an opaque string encoded as hex.<br \/>\ntype EDNS0_NSID struct {<br \/>\nCode uint16 \/\/ Always EDNS0NSID<br \/>\nNsid string \/\/ This string needs to be hex encoded<br \/>\n}<\/p>\n<p>\u5176\u4e2d EDNS0NSID &#061; 0x3&#xff08;\u89c1\u540c\u6587\u4ef6 \u7b2c 16 \u884c&#xff09;&#xff0c;\u800c Nsid \u5b57\u6bb5\u7684\u53d6\u503c\u5fc5\u987b\u662f\u5341\u516d\u8fdb\u5236\u7f16\u7801\u7684\u5b57\u7b26\u4e32\u2014\u2014\u8fd9\u6b63\u662f\u540e\u7eed\u7406\u89e3\u63d2\u4ef6\u6e90\u7801\u4e2d hex.EncodeToString \u8c03\u7528\u7684\u5173\u952e\u7ebf\u7d22\u3002<\/p>\n<h4>\u5178\u578b\u5e94\u7528\u573a\u666f<\/h4>\n<p>\u63d2\u4ef6\u6587\u6863\u660e\u786e\u6307\u51fa\u4e86\u5b83\u7684\u4e24\u4e2a\u6838\u5fc3\u7528\u9014&#xff1a;<\/p>\n<ul>\n<li>anycast \u73af\u5883&#xff1a;\u5f53\u591a\u4e2a\u670d\u52a1\u5668\u5171\u4eab\u540c\u4e00\u7ec4\u4efb\u64ad\u5730\u5740\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u65f6&#xff0c;\u5ba2\u6237\u7aef\u65e0\u6cd5\u4ec5\u51ed IP \u5224\u65ad\u5e94\u7b54\u6765\u6e90\u3002NSID \u8ba9\u4efb\u4e00\u5b9e\u4f8b\u90fd\u80fd\u5728\u5e94\u7b54\u4e2d&#034;\u81ea\u62a5\u5bb6\u95e8&#034;&#xff0c;\u4ece\u800c\u5b9a\u4f4d\u5230\u5b9e\u9645\u5904\u7406\u8bf7\u6c42\u7684\u90a3\u53f0\u673a\u5668\u3002<\/li>\n<li>\u8c03\u8bd5\u6392\u969c&#xff1a;\u5728\u6392\u67e5&#034;\u4e3a\u4ec0\u4e48\u67d0\u53f0\u673a\u5668\u62ff\u5230\u9519\u8bef\u89e3\u6790\u7ed3\u679c&#034;\u65f6&#xff0c;NSID \u53ef\u4ee5\u5feb\u901f\u786e\u8ba4\u8bf7\u6c42\u5b9e\u9645\u547d\u4e2d\u4e86\u54ea\u53f0\u670d\u52a1\u5668&#xff0c;\u7f29\u5c0f\u6392\u67e5\u8303\u56f4\u3002<\/li>\n<\/ul>\n<p>\u9700\u8981\u7279\u522b\u8bf4\u660e\u7684\u662f&#xff1a;NSID \u662f\u4e00\u79cd\u5e94\u7b54\u6ce8\u5165\u673a\u5236&#xff0c;\u670d\u52a1\u5668\u53ea\u6709\u5728\u5ba2\u6237\u7aef\u8bf7\u6c42\u4e2d\u643a\u5e26\u4e86 NSID \u9009\u9879\u65f6&#xff0c;\u624d\u4f1a\u5728\u5e94\u7b54\u4e2d\u56de\u586b NSID&#xff08;\u8be6\u89c1\u4e0b\u6587\u6e90\u7801\u5206\u6790&#xff09;&#xff0c;\u56e0\u6b64\u5b83\u4e0d\u4f1a\u5bf9\u4e0d\u652f\u6301 EDNS0 \u7684\u4f20\u7edf\u5ba2\u6237\u7aef\u4ea7\u751f\u4efb\u4f55\u5f71\u54cd\u3002<\/p>\n<h3>\u8bed\u6cd5\u4e0e\u914d\u7f6e<\/h3>\n<p>nsid \u63d2\u4ef6\u7684\u8bed\u6cd5\u6781\u5176\u7b80\u5355&#xff1a;<\/p>\n<p>nsid [DATA]<\/p>\n<ul>\n<li>DATA&#xff1a;\u8981\u5199\u5165 NSID \u8bb0\u5f55\u4e2d\u7684\u5b57\u7b26\u4e32&#xff08;\u670d\u52a1\u5668\u6807\u8bc6\u7b26&#xff09;\u3002<\/li>\n<li>DATA \u7701\u7565\u65f6&#xff1a;\u63d2\u4ef6\u9ed8\u8ba4\u4f7f\u7528\u4e3b\u673a\u540d&#xff08;hostname&#xff09;\u4f5c\u4e3a\u6807\u8bc6\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e00\u9ed8\u8ba4\u884c\u4e3a\u5728 setup.go \u7684\u914d\u7f6e\u89e3\u6790\u51fd\u6570 nsidParse \u4e2d\u6709\u660e\u786e\u5b9e\u73b0&#xff1a;<\/p>\n<p>func nsidParse(c *caddy.Controller) (string, error) {<br \/>\n\/\/ Use hostname as the default<br \/>\nnsid, err :&#061; os.Hostname()<br \/>\nif err !&#061; nil {<br \/>\nnsid &#061; &#034;localhost&#034;<br \/>\n}<br \/>\ni :&#061; 0<br \/>\nfor c.Next() {<br \/>\nif i &gt; 0 {<br \/>\nreturn nsid, plugin.ErrOnce<br \/>\n}<br \/>\ni&#043;&#043;<br \/>\nargs :&#061; c.RemainingArgs()<br \/>\nif len(args) &gt; 0 {<br \/>\nnsid &#061; strings.Join(args, &#034; &#034;)<br \/>\n}<br \/>\n}<br \/>\nreturn nsid, nil<br \/>\n}<\/p>\n<p>\u4ece\u8fd9\u6bb5\u4ee3\u7801\u53ef\u4ee5\u63d0\u70bc\u51fa\u4e09\u4e2a\u5173\u952e\u884c\u4e3a&#xff1a;<\/p>\n<li>\u9ed8\u8ba4\u6807\u8bc6\u7b26&#xff1a;\u4f18\u5148\u53d6 os.Hostname()&#xff1b;\u82e5\u83b7\u53d6\u4e3b\u673a\u540d\u5931\u8d25&#xff0c;\u5219\u56de\u9000\u4e3a\u5b57\u7b26\u4e32 &#034;localhost&#034;\u3002\u8fd9\u610f\u5473\u7740\u5728\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u5373\u4f7f\u4e0d\u663e\u5f0f\u914d\u7f6e DATA&#xff0c;\u6bcf\u53f0\u670d\u52a1\u5668\u7684 NSID \u4e5f\u4f1a\u56e0\u4e3b\u673a\u540d\u4e0d\u540c\u800c\u5929\u7136\u533a\u5206\u3002<\/li>\n<li>\u591a\u53c2\u6570\u62fc\u63a5&#xff1a;DATA \u652f\u6301\u5305\u542b\u7a7a\u683c\u7684\u5b57\u7b26\u4e32&#xff0c;\u914d\u7f6e\u4e2d\u7684\u591a\u4e2a\u53c2\u6570\u4f1a\u901a\u8fc7 strings.Join(args, &#034; &#034;) \u4ee5\u5355\u4e2a\u7a7a\u683c\u8fde\u63a5\u6210\u4e00\u4e2a\u6574\u4f53\u3002\u4f8b\u5982 nsid Use The Force \u6700\u7ec8\u5f97\u5230\u7684\u6807\u8bc6\u7b26\u662f &#034;Use The Force&#034;\u3002<\/li>\n<li>\u6bcf\u4e2a Server Block \u53ea\u80fd\u7528\u4e00\u6b21&#xff1a;\u5faa\u73af\u4e2d\u7b2c\u4e8c\u6b21\u51fa\u73b0 nsid \u6307\u4ee4\u65f6\u76f4\u63a5\u8fd4\u56de plugin.ErrOnce&#xff0c;\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\u5e76\u62a5\u9519\u3002\u8fd9\u4e5f\u662f\u539f\u6587\u6863\u4e2d&#034;\u672c\u63d2\u4ef6\u6bcf\u4e2a Server Block \u53ea\u80fd\u4f7f\u7528\u4e00\u6b21&#034;\u8fd9\u4e00\u9650\u5236\u7684\u6e90\u7801\u51fa\u5904\u3002<\/li>\n<p>\u63d2\u4ef6\u7684\u6ce8\u518c\u4e0e\u88c5\u914d\u53d1\u751f\u5728\u540c\u6587\u4ef6\u7684 init \u51fd\u6570\u4e2d&#xff1a;<\/p>\n<p>func init() { plugin.Register(&#034;nsid&#034;, setup) }<\/p>\n<p>setup \u5c06\u89e3\u6790\u51fa\u7684\u6807\u8bc6\u7b26\u5c01\u88c5\u4e3a Nsid{Next: next, Data: nsid} \u5b9e\u4f8b&#xff0c;\u6302\u8f7d\u5230\u5f53\u524d Server Block \u7684\u63d2\u4ef6\u94fe\u4e2d&#xff08;setup.go \u7b2c 14-25 \u884c&#xff09;\u3002<\/p>\n<h4>Corefile \u914d\u7f6e\u793a\u4f8b<\/h4>\n<p>\u5728 CoreDNS \u7684 Corefile \u4e2d\u542f\u7528 nsid \u7684\u65b9\u5f0f\u5982\u4e0b&#xff08;\u6765\u81ea\u63d2\u4ef6\u539f\u7248 README \u793a\u4f8b&#xff09;&#xff1a;<\/p>\n<p>example.org {<br \/>\n    whoami<br \/>\n    nsid Use The Force<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u914d\u7f6e\u7684\u542b\u4e49\u662f&#xff1a;\u5bf9 example.org \u533a\u57df\u542f\u7528 whoami \u4e0e nsid \u4e24\u4e2a\u63d2\u4ef6&#xff0c;\u5176\u4e2d nsid \u4f7f\u7528\u81ea\u5b9a\u4e49\u6807\u8bc6\u7b26 Use The Force\u3002whoami \u63d2\u4ef6\u8d1f\u8d23\u8fd4\u56de\u5173\u4e8e\u5ba2\u6237\u7aef\u7684\u67e5\u8be2\u4fe1\u606f&#xff0c;\u4e0e nsid \u914d\u5408\u53ef\u4ee5\u76f4\u89c2\u9a8c\u8bc1\u6807\u8bc6\u7b26\u6ce8\u5165\u6548\u679c\u3002<\/p>\n<p>\u5173\u4e8e\u63d2\u4ef6\u5728\u8bf7\u6c42\u94fe\u4e2d\u7684\u4f4d\u7f6e&#xff0c;\u53ef\u4ee5\u67e5\u9605 core\/dnsserver\/zdirectives.go&#xff1a;\u8be5\u6587\u4ef6\u662f CoreDNS \u5404\u63d2\u4ef6\u6267\u884c\u987a\u5e8f\u7684\u6ce8\u518c\u8868&#xff0c;nsid \u4f4d\u4e8e reload \u4e4b\u540e\u3001bufsize \u4e4b\u524d\u3002\u7531\u4e8e\u5b83\u9700\u8981\u5148\u4e8e\u4e0b\u6e38\u63d2\u4ef6\u770b\u5230\u8bf7\u6c42\u3001\u5e76\u5728\u5e94\u7b54\u56de\u7a0b\u65f6\u6ce8\u5165 NSID \u9009\u9879&#xff0c;\u56e0\u6b64\u88ab\u5b89\u6392\u5728\u63d2\u4ef6\u94fe\u7684\u8f83\u524d\u4f4d\u7f6e\u3002<\/p>\n<h3>\u5de5\u4f5c\u6d41\u7a0b\u4e0e\u6e90\u7801\u5b9e\u73b0<\/h3>\n<p>nsid \u63d2\u4ef6\u867d\u7136\u53ea\u6709\u4e00\u4efd\u6838\u5fc3\u6587\u4ef6&#xff0c;\u4f46\u5176\u5de5\u4f5c\u6d41\u7a0b\u8bbe\u8ba1\u76f8\u5f53\u7cbe\u5de7\u3002\u6e90\u7801\u4f4d\u4e8e plugin\/nsid\/nsid.go&#xff0c;\u6574\u4f53\u5206\u4e3a\u4e09\u4e2a\u5c42\u6b21\u3002<\/p>\n<h4>\u63d2\u4ef6\u4e3b\u4f53&#xff1a;Nsid \u7ed3\u6784<\/h4>\n<p>\/\/ Nsid plugin<br \/>\ntype Nsid struct {<br \/>\nNext plugin.Handler<br \/>\nData string<br \/>\n}<\/p>\n<p>Nsid \u6301\u6709\u4e24\u4e2a\u5b57\u6bb5&#xff1a;\u63d2\u4ef6\u94fe\u4e0b\u6e38\u5904\u7406\u5668 Next \u4e0e\u670d\u52a1\u5668\u6807\u8bc6\u7b26 Data&#xff0c;\u5b9e\u73b0\u4e86 plugin.Handler \u63a5\u53e3\u3002<\/p>\n<h4>\u8bf7\u6c42\u62e6\u622a&#xff1a;ServeDNS<\/h4>\n<p>\/\/ ServeDNS implements the plugin.Handler interface.<br \/>\nfunc (n Nsid) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {<br \/>\nif option :&#061; r.IsEdns0(); option !&#061; nil {<br \/>\nfor _, o :&#061; range option.Option {<br \/>\nif _, ok :&#061; o.(*dns.EDNS0_NSID); ok {<br \/>\nnw :&#061; &amp;ResponseWriter{ResponseWriter: w, Data: n.Data, request: r}<br \/>\nreturn plugin.NextOrFailure(n.Name(), n.Next, ctx, nw, r)<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\nreturn plugin.NextOrFailure(n.Name(), n.Next, ctx, w, r)<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u4f53\u73b0\u4e86 NSID \u534f\u8bae\u7684\u534f\u5546\u673a\u5236&#xff1a;<\/p>\n<li>\u9996\u5148\u8c03\u7528 r.IsEdns0() \u68c0\u67e5\u5ba2\u6237\u7aef\u8bf7\u6c42\u662f\u5426\u643a\u5e26 EDNS0 OPT \u8bb0\u5f55&#xff1b;<\/li>\n<li>\u82e5\u5b58\u5728&#xff0c;\u5219\u904d\u5386 OPT \u8bb0\u5f55\u4e2d\u7684\u9009\u9879&#xff0c;\u67e5\u627e\u7c7b\u578b\u4e3a *dns.EDNS0_NSID \u7684\u9009\u9879\u2014\u2014\u5373\u5ba2\u6237\u7aef\u662f\u5426\u663e\u5f0f\u8bf7\u6c42\u4e86 NSID&#xff1b;<\/li>\n<li>\u53ea\u6709\u5728\u5ba2\u6237\u7aef\u8bf7\u6c42\u4e86 NSID \u7684\u60c5\u51b5\u4e0b&#xff0c;\u63d2\u4ef6\u624d\u7528\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7684 ResponseWriter \u5305\u88c5\u539f\u59cb\u54cd\u5e94\u5199\u5165\u5668 w&#xff0c;\u7136\u540e\u7ee7\u7eed\u8c03\u7528 plugin.NextOrFailure \u5c06\u8bf7\u6c42\u4ea4\u7ed9\u4e0b\u6e38\u63d2\u4ef6\u5904\u7406&#xff1b;<\/li>\n<li>\u82e5\u5ba2\u6237\u7aef\u672a\u8bf7\u6c42 NSID&#xff0c;\u5219\u76f4\u63a5\u900f\u4f20\u539f\u59cb\u5199\u5165\u5668&#xff0c;\u4e0d\u505a\u4efb\u4f55\u5e72\u9884\u3002<\/li>\n<p>\u8fd9\u4e00\u8bbe\u8ba1\u786e\u4fdd\u4e86 nsid \u5bf9&#034;\u4f20\u7edf&#034;DNS \u67e5\u8be2\u5b8c\u5168\u900f\u660e&#xff0c;\u4e0d\u4f1a\u7ed9\u4e0d\u652f\u6301 EDNS0 \u7684\u5ba2\u6237\u7aef\u5e26\u6765\u4efb\u4f55\u534f\u8bae\u8d1f\u62c5\u3002<\/p>\n<h4>\u5e94\u7b54\u6ce8\u5165&#xff1a;ResponseWriter.WriteMsg<\/h4>\n<p>\u771f\u6b63\u5411\u5e94\u7b54\u6ce8\u5165 NSID \u7684\u903b\u8f91\u96c6\u4e2d\u5728 ResponseWriter \u7684 WriteMsg \u65b9\u6cd5\u4e2d&#xff1a;<\/p>\n<p>\/\/ WriteMsg implements the dns.ResponseWriter interface.<br \/>\nfunc (w *ResponseWriter) WriteMsg(res *dns.Msg) error {<br \/>\nif w.request.IsEdns0() !&#061; nil &amp;&amp; res.IsEdns0() &#061;&#061; nil {<br \/>\nres.SetEdns0(w.request.IsEdns0().UDPSize(), true)<br \/>\n}<\/p>\n<p>if option :&#061; res.IsEdns0(); option !&#061; nil {<br \/>\nvar exists bool<\/p>\n<p>for _, o :&#061; range option.Option {<br \/>\nif e, ok :&#061; o.(*dns.EDNS0_NSID); ok {<br \/>\ne.Code &#061; dns.EDNS0NSID<br \/>\ne.Nsid &#061; hex.EncodeToString([]byte(w.Data))<br \/>\nexists &#061; true<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ Append the NSID if it doesn&#039;t exist in EDNS0 options<br \/>\nif !exists {<br \/>\noption.Option &#061; append(option.Option, &amp;dns.EDNS0_NSID{<br \/>\nCode: dns.EDNS0NSID,<br \/>\nNsid: hex.EncodeToString([]byte(w.Data)),<br \/>\n})<br \/>\n}<br \/>\n}<\/p>\n<p>return w.ResponseWriter.WriteMsg(res)<br \/>\n}<\/p>\n<p>\u8fd9\u91cc\u5305\u542b\u4e86\u4e24\u4e2a\u503c\u5f97\u6ce8\u610f\u7684\u5b9e\u73b0\u7ec6\u8282&#xff1a;<\/p>\n<ul>\n<li>EDNS0 \u81ea\u52a8\u8865\u9f50&#xff1a;\u5f53\u4e0b\u6e38\u63d2\u4ef6\u751f\u6210\u7684\u5e94\u7b54\u5c1a\u672a\u9644\u5e26 EDNS0 \u8bb0\u5f55\u65f6&#xff0c;\u63d2\u4ef6\u4f1a\u57fa\u4e8e\u8bf7\u6c42\u4e2d\u7684 UDPSize \u8c03\u7528 res.SetEdns0(&#8230;) \u4e3a\u5e94\u7b54\u8865\u5efa OPT \u8bb0\u5f55\u3002\u8fd9\u4fdd\u8bc1\u4e86&#034;\u5ba2\u6237\u7aef\u5e26\u4e86 EDNS0 \u8bf7\u6c42&#xff0c;\u5e94\u7b54\u5c31\u5fc5\u7136\u80fd\u627f\u8f7d NSID&#034;\u3002<\/li>\n<li>\u5341\u516d\u8fdb\u5236\u7f16\u7801&#xff1a;NSID \u503c\u5728\u5199\u5165\u5e94\u7b54\u524d&#xff0c;\u7edf\u4e00\u901a\u8fc7 hex.EncodeToString([]byte(w.Data)) \u8f6c\u6362\u4e3a\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32\u3002\u8fd9\u6b63\u662f RFC 5001 \u4e0e miekg\/dns \u5e93\u7684\u8981\u6c42\u2014\u2014EDNS0_NSID.Nsid \u5b57\u6bb5\u672c\u8eab\u5c31\u662f hex \u7f16\u7801\u7684\u5b57\u7b26\u4e32&#xff08;\u89c1 edns.go \u7b2c 235 \u884c&#xff09;&#xff0c;\u5ba2\u6237\u7aef\u5c55\u793a\u65f6\u518d\u5c06\u5176\u8fd8\u539f\u4e3a\u53ef\u8bfb\u6587\u672c\u3002<\/li>\n<li>\u53bb\u91cd\u4fdd\u62a4&#xff1a;\u82e5\u4e0b\u6e38\u63d2\u4ef6&#xff08;\u5982 rewrite&#xff09;\u5df2\u7ecf\u5728\u5e94\u7b54\u4e2d\u52a0\u5165\u4e86 NSID \u9009\u9879&#xff0c;\u63d2\u4ef6\u4f1a\u76f4\u63a5\u6539\u5199\u5176 Code \u4e0e Nsid \u5b57\u6bb5\u800c\u975e\u91cd\u590d\u8ffd\u52a0&#xff0c;\u4fdd\u8bc1\u6bcf\u6761\u5e94\u7b54\u6070\u597d\u643a\u5e26\u4e00\u4e2a NSID \u9009\u9879\u3002<\/li>\n<\/ul>\n<p>\u6b64\u5916&#xff0c;Name() \u65b9\u6cd5\u8fd4\u56de &#034;nsid&#034;&#xff0c;\u662f\u63d2\u4ef6\u5728\u9519\u8bef\u65e5\u5fd7\u3001\u5065\u5eb7\u68c0\u67e5\u7b49\u573a\u666f\u4e2d\u5c55\u793a\u7684\u89c4\u8303\u540d\u79f0\u3002<\/p>\n<h3>\u5ba2\u6237\u7aef\u9a8c\u8bc1&#xff1a;dig &#043;nsid \u5b9e\u64cd<\/h3>\n<p>\u63d2\u4ef6 README \u7ed9\u51fa\u4e86\u5b8c\u6574\u7684\u9a8c\u8bc1\u573a\u666f&#xff1a;\u5ba2\u6237\u7aef\u4f7f\u7528 dig \u7684 &#043;nsid \u9009\u9879\u53d1\u8d77\u67e5\u8be2&#xff0c;\u5411\u670d\u52a1\u5668\u8bf7\u6c42 NSID \u6807\u8bc6\u3002<\/p>\n<h4>\u67e5\u8be2\u547d\u4ee4<\/h4>\n<p>% dig &#043;nsid &#064;localhost a whoami.example.org<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<ul>\n<li>&#043;nsid&#xff1a;\u8ba9 dig \u5728\u67e5\u8be2\u4e2d\u9644\u5e26 NSID \u9009\u9879&#xff08;\u7b49\u4ef7\u4e8e\u5728 EDNS0 OPT \u8bb0\u5f55\u4e2d\u52a0\u5165 option code 0x3&#xff09;&#xff1b;<\/li>\n<li>&#064;localhost&#xff1a;\u6307\u5b9a\u76ee\u6807 DNS \u670d\u52a1\u5668\u5730\u5740&#xff1b;<\/li>\n<li>a whoami.example.org&#xff1a;\u67e5\u8be2\u8be5\u57df\u540d\u7684 A \u8bb0\u5f55\u3002<\/li>\n<\/ul>\n<h4>\u5e94\u7b54\u89e3\u8bfb<\/h4>\n<p>;; Got answer:<br \/>\n;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 46880<br \/>\n;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 3<\/p>\n<p>&#8230;.<\/p>\n<p>; OPT PSEUDOSECTION:<br \/>\n; EDNS: version: 0, flags:; udp: 4096<br \/>\n; NSID: 55 73 65 20 54 68 65 20 46 6f 72 63 65 (&#034;Use The Force&#034;)<br \/>\n;; QUESTION SECTION:<br \/>\n;whoami.example.org.INA<\/p>\n<p>\u5173\u952e\u8f93\u51fa\u4f4d\u4e8e OPT PSEUDOSECTION&#xff1a;<\/p>\n<ul>\n<li>EDNS: version: 0, flags:; udp: 4096&#xff1a;\u5e94\u7b54\u643a\u5e26 EDNS0 \u8bb0\u5f55&#xff0c;UDP \u5927\u5c0f\u534f\u5546\u4e3a 4096 \u5b57\u8282&#xff1b;<\/li>\n<li>NSID: 55 73 65 20 54 68 65 20 46 6f 72 63 65 (&#034;Use The Force&#034;)&#xff1a;NSID \u9009\u9879\u5185\u5bb9&#xff0c;\u5de6\u4fa7\u4e3a\u5341\u516d\u8fdb\u5236\u5b57\u8282\u5e8f\u5217&#xff0c;\u53f3\u4fa7\u4e3a dig \u8fd8\u539f\u51fa\u7684\u53ef\u8bfb\u5b57\u7b26\u4e32&#xff0c;\u4e8c\u8005\u4e00\u4e00\u5bf9\u5e94\u3002<\/li>\n<\/ul>\n<p>\u5c06\u5341\u516d\u8fdb\u5236\u5e8f\u5217\u624b\u5de5\u89e3\u7801\u53ef\u4ee5\u9a8c\u8bc1\u5e95\u5c42\u7f16\u7801\u903b\u8f91&#xff1a;<\/p>\n<table>\n<tr>Hex \u5b57\u8282ASCII \u5b57\u7b26<\/tr>\n<tbody>\n<tr>\n<td>55<\/td>\n<td>U<\/td>\n<\/tr>\n<tr>\n<td>73<\/td>\n<td>s<\/td>\n<\/tr>\n<tr>\n<td>65<\/td>\n<td>e<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>&#xff08;\u7a7a\u683c&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>54<\/td>\n<td>T<\/td>\n<\/tr>\n<tr>\n<td>68<\/td>\n<td>h<\/td>\n<\/tr>\n<tr>\n<td>65<\/td>\n<td>e<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>&#xff08;\u7a7a\u683c&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>46<\/td>\n<td>F<\/td>\n<\/tr>\n<tr>\n<td>6f<\/td>\n<td>o<\/td>\n<\/tr>\n<tr>\n<td>72<\/td>\n<td>r<\/td>\n<\/tr>\n<tr>\n<td>63<\/td>\n<td>c<\/td>\n<\/tr>\n<tr>\n<td>65<\/td>\n<td>e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7ec4\u5408\u8d77\u6765\u6b63\u662f Use The Force\u2014\u2014\u4e0e\u63d2\u4ef6\u6e90\u7801\u4e2d hex.EncodeToString([]byte(w.Data)) \u7684\u7f16\u7801\u8def\u5f84\u5b8c\u5168\u543b\u5408&#xff08;nsid.go \u7b2c 51 \u884c&#xff09;\u3002\u5b9e\u9645\u6392\u969c\u65f6&#xff0c;\u8fd0\u7ef4\u65e0\u9700\u624b\u5de5\u89e3\u7801&#xff1a;\u4f7f\u7528 dig &#043;nsid \u65f6 dig \u4f1a\u81ea\u52a8\u5728\u62ec\u53f7\u4e2d\u6253\u5370\u660e\u6587&#xff0c;drill\u3001kdig \u7b49\u5de5\u5177\u4ea6\u6709\u7c7b\u4f3c\u5c55\u793a\u80fd\u529b\u3002<\/p>\n<h3>\u5b9e\u6218\u573a\u666f&#xff1a;anycast \u591a\u5b9e\u4f8b\u6392\u969c\u4e0e Cloudpods \u96c6\u6210<\/h3>\n<h4>anycast \u73af\u5883\u4e0b\u7684\u5e94\u7b54\u6eaf\u6e90<\/h4>\n<p>\u5047\u8bbe\u4f60\u5728\u4e09\u4e2a\u53ef\u7528\u533a\u5404\u90e8\u7f72\u4e00\u53f0 CoreDNS&#xff0c;\u4e09\u53f0\u673a\u5668\u901a\u8fc7 anycast \u5171\u4eab\u540c\u4e00 VIP\u3002\u5f53\u5ba2\u6237\u7aef\u62a5\u544a&#034;\u89e3\u6790\u7ed3\u679c\u5f02\u5e38&#034;\u65f6&#xff0c;\u4f20\u7edf\u6392\u67e5\u9700\u8981\u9010\u53f0\u767b\u5f55\u670d\u52a1\u5668\u7ffb\u65e5\u5fd7&#xff0c;\u6548\u7387\u4f4e\u4e0b\u3002\u542f\u7528 nsid \u540e&#xff0c;\u53ea\u9700\u5728\u5ba2\u6237\u7aef\u6267\u884c&#xff1a;<\/p>\n<p>dig &#043;nsid &#064;vip &lt;\u67e5\u8be2\u540d&gt; ANY<\/p>\n<p>\u5e94\u7b54\u4e2d\u643a\u5e26\u7684 NSID&#xff08;\u9ed8\u8ba4\u4e3a\u5404\u81ea\u4e3b\u673a\u540d&#xff09;\u4f1a\u76f4\u63a5\u544a\u8bc9\u4f60\u672c\u6b21\u67e5\u8be2\u5b9e\u9645\u843d\u5230\u4e86\u54ea\u4e00\u53f0\u673a\u5668&#xff0c;\u5c06\u6392\u67e5\u8303\u56f4\u4ece&#034;\u4e09\u53f0\u5168\u90e8&#034;\u7f29\u5c0f\u5230&#034;\u5177\u4f53\u4e00\u53f0&#034;\u3002\u914d\u5408 prometheus \u63d2\u4ef6\u6216\u8bbf\u95ee\u65e5\u5fd7&#xff0c;\u8fd8\u80fd\u8fdb\u4e00\u6b65\u4ea4\u53c9\u9a8c\u8bc1\u8be5\u673a\u5668\u7684\u8d1f\u8f7d\u4e0e\u5065\u5eb7\u72b6\u6001\u3002<\/p>\n<h4>\u5728 Cloudpods \u7684 DNS \u670d\u52a1\u4e2d\u4f7f\u7528<\/h4>\n<p>Cloudpods \u7684\u4ed3\u5e93\u4e2d&#xff0c;pkg\/dns \u662f\u4e00\u4e2a\u57fa\u4e8e CoreDNS \u63d2\u4ef6\u6846\u67b6\u5b9e\u73b0\u7684\u81ea\u7814 DNS \u670d\u52a1&#xff08;Cloudpods \u79f0\u4e4b\u4e3a region-dns&#xff09;&#xff0c;\u4e3a\u865a\u62df\u673a\u3001\u5bbf\u4e3b\u673a\u3001Kubernetes Service \u7b49\u63d0\u4f9b\u57df\u540d\u89e3\u6790\u3002\u5b83\u590d\u7528\u4e86\u672c\u4ed3\u5e93 vendor \u7684 CoreDNS v1.10.1 \u63d2\u4ef6\u4f53\u7cfb&#xff1a;<\/p>\n<ul>\n<li>\u4ed3\u5e93 go.mod \u58f0\u660e\u4f9d\u8d56 github.com\/coredns\/caddy v1.1.1 \u4e0e github.com\/coredns\/coredns v1.10.1&#xff1b;<\/li>\n<li>\u81ea\u7814\u63d2\u4ef6\u901a\u8fc7 plugin.Register(PluginName, setup) \u6ce8\u518c\u8fdb CoreDNS \u6846\u67b6&#xff08;\u89c1 pkg\/dns\/setup.go&#xff09;&#xff0c;\u5176\u914d\u7f6e\u89e3\u6790\u3001AddPlugin \u88c5\u914d\u65b9\u5f0f\u4e0e nsid \u7684 setup.go \u5c5e\u4e8e\u540c\u4e00\u5957\u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64&#xff0c;Cloudpods \u7684 DNS Corefile \u4e2d\u540c\u6837\u53ef\u4ee5\u76f4\u63a5\u542f\u7528 nsid \u6307\u4ee4&#xff0c;\u4f8b\u5982\u5728 pkg\/dns \u63d0\u4f9b\u7684 Corefile \u914d\u7f6e&#xff08;\u5176\u683c\u5f0f\u4e0e\u884c\u4e3a\u7ea6\u5b9a\u89c1 pkg\/dns\/README.md&#xff09;\u4e2d\u52a0\u5165&#xff1a;<\/p>\n<p>.:53 {<br \/>\n    nsid<br \/>\n    dns<br \/>\n}<\/p>\n<p>\u7701\u7565 DATA \u65f6&#xff0c;\u6bcf\u4e2a region-dns \u5b9e\u4f8b\u4f1a\u81ea\u52a8\u4ee5\u5176\u4e3b\u673a\u540d\u4f5c\u4e3a NSID\u3002\u8fd9\u6837\u5728\u63a5\u5165\u5916\u90e8\u4e0a\u6e38\u89e3\u6790\u5f02\u5e38\u6216\u6392\u67e5\u591a\u533a\u57df DNS \u5e94\u7b54\u5dee\u5f02\u65f6&#xff0c;\u5373\u53ef\u501f\u52a9 dig &#043;nsid \u786e\u8ba4\u5e94\u7b54\u6765\u6e90&#xff0c;\u65e0\u9700\u767b\u5f55\u5404\u8282\u70b9\u9010\u4e00\u6bd4\u5bf9\u3002<\/p>\n<h3>\u6ce8\u610f\u4e8b\u9879\u4e0e\u5e38\u89c1\u95ee\u9898<\/h3>\n<li>\u6bcf Server Block \u4ec5\u9650\u4e00\u6b21&#xff1a;\u540c\u4e00 Corefile \u7684 Server Block \u4e2d\u91cd\u590d\u4e66\u5199 nsid \u4f1a\u5bfc\u81f4\u914d\u7f6e\u52a0\u8f7d\u5931\u8d25&#xff08;\u6e90\u7801\u5c42\u9762\u8fd4\u56de plugin.ErrOnce&#xff09;\u3002<\/li>\n<li>\u5ba2\u6237\u7aef\u9700\u4e3b\u52a8\u8bf7\u6c42&#xff1a;NSID \u53ea\u5bf9\u643a\u5e26 NSID \u9009\u9879&#xff08;dig &#043;nsid&#xff09;\u7684\u67e5\u8be2\u751f\u6548&#xff1b;\u666e\u901a\u67e5\u8be2\u7684\u5e94\u7b54\u4e0d\u4f1a\u9644\u52a0 NSID&#xff0c;\u5bf9\u8001\u5ba2\u6237\u7aef\u5b8c\u5168\u900f\u660e\u3002<\/li>\n<li>\u6807\u8bc6\u7b26\u5efa\u8bae\u5168\u5c40\u552f\u4e00&#xff1a;\u9ed8\u8ba4\u4f7f\u7528\u4e3b\u673a\u540d&#xff0c;\u82e5\u5404\u5b9e\u4f8b\u4e3b\u673a\u540d\u4e0d\u552f\u4e00&#xff08;\u4f8b\u5982\u5bb9\u5668\u5316\u90e8\u7f72\u4e2d\u4e3b\u673a\u540d\u76f8\u540c&#xff09;&#xff0c;\u5e94\u663e\u5f0f\u914d\u7f6e DATA \u4ee5\u4fdd\u8bc1\u6eaf\u6e90\u51c6\u786e\u6027\u3002<\/li>\n<li>\u591a\u8bcd\u6807\u8bc6\u7b26&#xff1a;DATA \u652f\u6301\u7a7a\u683c&#xff0c;\u591a\u4e2a\u8bcd\u4f1a\u81ea\u52a8\u4ee5\u7a7a\u683c\u8fde\u63a5&#xff0c;\u65e0\u9700\u5f15\u53f7\u3002<\/li>\n<li>NSID \u4e3a\u900f\u660e\u5b57\u8282\u4e32&#xff1a;\u534f\u8bae\u5c42\u9762\u5b83\u662f\u4e0d\u900f\u660e\u6570\u636e&#xff0c;\u670d\u52a1\u5668\u53ef\u5199\u5165\u4efb\u610f\u5b57\u7b26\u4e32&#xff1b;miekg\/dns \u5e93\u5f3a\u5236\u4ee5\u5341\u516d\u8fdb\u5236\u7f16\u7801\u4f20\u8f93&#xff0c;\u5ba2\u6237\u7aef\u4fa7\u81ea\u52a8\u89e3\u7801\u663e\u793a\u3002<\/li>\n<li>\u4e0d\u5f71\u54cd\u5e94\u7b54\u8bed\u4e49&#xff1a;NSID \u53ea\u8ffd\u52a0 EDNS0 \u9009\u9879&#xff0c;\u4e0d\u4fee\u6539\u5e94\u7b54\u7684\u5934\u90e8\u6807\u5fd7\u4f4d\u3001QUESTION\/ANSWER \u7b49\u6838\u5fc3\u533a\u6bb5&#xff0c;\u89e3\u6790\u7ed3\u679c\u4e0e\u539f\u5e94\u7b54\u5b8c\u5168\u4e00\u81f4\u3002<\/li>\n<h3>\u603b\u7ed3<\/h3>\n<p>nsid \u63d2\u4ef6\u4ee5\u6781\u4f4e\u7684\u914d\u7f6e\u6210\u672c&#xff08;\u4e00\u884c\u6307\u4ee4&#xff09;\u6362\u6765\u4e86 anycast \u4e0e\u591a\u5b9e\u4f8b\u573a\u666f\u4e0b\u81f3\u5173\u91cd\u8981\u7684&#034;\u5e94\u7b54\u6eaf\u6e90&#034;\u80fd\u529b&#xff1a;\u8bf7\u6c42\u7aef\u901a\u8fc7 dig &#043;nsid \u4e3b\u52a8\u534f\u5546&#xff0c;\u670d\u52a1\u7aef\u901a\u8fc7 nsid.go \u4e2d\u7684 ServeDNS \u62e6\u622a\u4e0e ResponseWriter.WriteMsg \u6ce8\u5165\u4e24\u4e2a\u73af\u8282&#xff0c;\u5c06\u5341\u516d\u8fdb\u5236\u7f16\u7801\u7684\u670d\u52a1\u5668\u6807\u8bc6\u7b26\u5199\u5165\u5e94\u7b54\u7684 EDNS0 OPT \u8bb0\u5f55\u3002\u5176\u9ed8\u8ba4\u53d6\u4e3b\u673a\u540d\u3001\u6bcf Server Block \u9650\u7528\u4e00\u6b21\u3001\u4ec5\u5bf9\u663e\u5f0f\u8bf7\u6c42\u54cd\u5e94\u7b49\u8bbe\u8ba1&#xff0c;\u90fd\u4f53\u73b0\u4e86&#034;\u6700\u5c0f\u4fb5\u5165\u3001\u6309\u9700\u751f\u6548&#034;\u7684\u63d2\u4ef6\u54f2\u5b66\u3002\u5728 Cloudpods \u8fd9\u7c7b\u57fa\u4e8e CoreDNS \u6846\u67b6\u6784\u5efa\u591a\u4e91 DNS \u670d\u52a1\u7684\u9879\u76ee\u4e2d&#xff0c;\u7406\u89e3 nsid \u7684\u534f\u8bae\u7ec6\u8282\u4e0e\u6e90\u7801\u5b9e\u73b0&#xff0c;\u80fd\u591f\u5e2e\u52a9\u4f60\u5728\u590d\u6742\u7f51\u7edc\u73af\u5883\u4e2d\u5feb\u901f\u5b9a\u4f4d\u89e3\u6790\u94fe\u8def\u95ee\u9898\u3002<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" class=\"gcb-icon-like\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261025113221-6adde8c563f5f.svg\" alt=\"\" width=\"16\" height=\"16\" \/> <span class=\"gcb-like-text\">\u8d5e<\/span>  <\/p>\n<p>   <span class=\"gcb-share-text\">\u5206\u4eab<\/span>  <\/p>\n<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u540e\u7aef<\/span><\/li>\n<li><span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><\/li>\n<li><span class=\"gcb-tag\">\u8fd0\u7ef4<\/span><\/li>\n<li><span class=\"gcb-tag\">\u865a\u62df\u5316<\/span><\/li>\n<li><span class=\"gcb-tag\">\u4eba\u5de5\u667a\u80fd<\/span><\/li>\n<li><span class=\"gcb-tag\">AI \u5e94\u7528<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011cloudpods<\/h3>\n<p class=\"gcb-project-desc\">\u5f00\u6e90\u3001\u4e91\u539f\u751f\u7684\u591a\u4e91\u7ba1\u7406\u53ca\u6df7\u5408\u4e91\u878d\u5408\u5e73\u53f0<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/yunionio\/cloudpods<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h4 class=\"gcb-related-title\">\u76f8\u5173\u63a8\u8350<\/h4>\n<ul class=\"gcb-related-list\">\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">CoreDNS nsid \u63d2\u4ef6&#xff1a;\u57fa\u4e8e RFC 5001 \u4e3a\u6bcf\u4e2a DNS \u54cd\u5e94\u6ce8\u5165\u670d\u52a1\u5668\u6807\u8bc6<\/h5>\n<p class=\"gcb-related-item-desc\">CoreDNS nsid \u63d2\u4ef6&#xff1a;\u57fa\u4e8e RFC 5001 \u4e3a\u6bcf\u4e2a DNS \u54cd\u5e94\u6ce8\u5165\u670d\u52a1\u5668\u6807\u8bc6 \u5bfc\u8bfb nsid \u662f CoreDNS \u7684\u4e00\u4e2a\u5185\u5efa\u63d2\u4ef6&#xff0c;\u5b83\u6309\u7167 RFC <\/p>\n<p>     <span class=\"gcb-tag\">\u540e\u7aef<\/span><br \/>\n     <span class=\"gcb-tag\">\u7f51\u7edc<\/span><br \/>\n     <span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">CoreDNS 1.0.1 \u7248\u672c\u6df1\u5ea6\u89e3\u6790&#xff1a;file \u63d2\u4ef6\u5d29\u6e83\u4fee\u590d\u4e0e RFC 5001 NSID \u63d2\u4ef6\u5b9e\u73b0<\/h5>\n<p class=\"gcb-related-item-desc\">CoreDNS 1.0.1 \u7248\u672c\u6df1\u5ea6\u89e3\u6790&#xff1a;file \u63d2\u4ef6\u5d29\u6e83\u4fee\u590d\u4e0e RFC 5001 NSID \u63d2\u4ef6\u5b9e\u73b0 \u5bfc\u8bfb CoreDNS 1.0.1 \u662f\u7ee7 1.0.0&#xff08;C<\/p>\n<p>     <span class=\"gcb-tag\">\u540e\u7aef<\/span><br \/>\n     <span class=\"gcb-tag\">\u7f51\u7edc<\/span><br \/>\n     <span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">\u6df1\u5165\u89e3\u6790 CoreDNS acl \u63d2\u4ef6&#xff1a;\u57fa\u4e8e\u6e90 IP \u7684 DNS \u8bbf\u95ee\u63a7\u5236\u4e0e Cloudpods region-dns \u96c6\u6210\u5b9e\u8df5<\/h5>\n<p class=\"gcb-related-item-desc\">\u6df1\u5165\u89e3\u6790 CoreDNS acl \u63d2\u4ef6&#xff1a;\u57fa\u4e8e\u6e90 IP \u7684 DNS \u8bbf\u95ee\u63a7\u5236\u4e0e Cloudpods region dns \u96c6\u6210\u5b9e\u8df5 \u672c\u6587\u4ee5 CoreDNS \u5b98\u65b9 <\/p>\n<p>     <span class=\"gcb-tag\">\u540e\u7aef<\/span><br \/>\n     <span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><br \/>\n     <span class=\"gcb-tag\">\u8fd0\u7ef4<\/span><br \/>\n     <span class=\"gcb-tag\">\u865a\u62df\u5316<\/span><br \/>\n     <span class=\"gcb-tag\">\u4eba\u5de5\u667a\u80fd<\/span><br \/>\n     <span class=\"gcb-tag\">AI \u5e94\u7528<\/span>\n      <\/li>\n<\/ul>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0a\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  \u89e3\u51b3\u5e38\u89c1\u95ee\u9898&#xff1a;AwesomeSplash\u4f7f\u7528\u4e2d\u768410\u4e2a\u7591\u96be\u6742\u75c7\u6307\u5357 <\/p>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0b\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  Cloud Document Converter\u793e\u533a\u751f\u6001&#xff1a;\u5982\u4f55\u83b7\u5f97\u652f\u6301\u4e0e\u53c2\u4e0e\u8ba8\u8bba <\/p>\n<p>\u521b\u4f5c\u58f0\u660e\uff1a\u672c\u6587\u90e8\u5206\u5185\u5bb9\u7531AI\u8f85\u52a9\u751f\u6210\uff08AIGC\uff09\uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u540e\u7aef\u4e91\u539f\u751f\u8fd0\u7ef4\u865a\u62df\u5316\u4eba\u5de5\u667a\u80fdAI \u5e94\u7528 \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011cloudpods \u5f00\u6e90\u3001\u4e91\u539f\u751f\u7684\u591a\u4e91\u7ba1\u7406\u53ca\u6df7\u5408\u4e91\u878d\u5408\u5e73\u53f0 \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/yunionio\/cloudpods \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d  \u5bfc\u8bfb<br \/>\nnsid \u662f CoreDNS \u4e2d\u4e00\u4e2a\u8f7b\u91cf\u4f46\u6781\u5177\u5b9e\u6218\u4ef7\u503c\u7684\u63d2\u4ef6&#xff1a;\u5b83\u5b9e\u73b0 RFC 5001 \u534f\u8bae&#xff0c;\u5728 DNS \u5e94\u7b54\u4e2d\u6ce8\u5165\u4e00\u4e2a EDNS0 OPT \u8d44\u6e90\u8bb0\u5f55&#xff0c;\u7528\u6765\u552f\u4e00\u6807\u8bc6\\&#8221;\u662f\u54ea\u4e00\u53f0\u670d\u52a1\u5668\u751f\u6210\u4e86\u8fd9<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-117881","post","type-post","status-publish","format-standard","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CoreDNS nsid \u63d2\u4ef6\u5168\u89e3\u6790\uff1a\u57fa\u4e8e RFC 5001 \u7684 DNS \u670d\u52a1\u5668\u6807\u8bc6\u673a\u5236\u4e0e Cloudpods \u96c6\u6210\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/117881.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CoreDNS nsid \u63d2\u4ef6\u5168\u89e3\u6790\uff1a\u57fa\u4e8e RFC 5001 \u7684 DNS \u670d\u52a1\u5668\u6807\u8bc6\u673a\u5236\u4e0e Cloudpods \u96c6\u6210\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u540e\u7aef\u4e91\u539f\u751f\u8fd0\u7ef4\u865a\u62df\u5316\u4eba\u5de5\u667a\u80fdAI \u5e94\u7528 \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011cloudpods \u5f00\u6e90\u3001\u4e91\u539f\u751f\u7684\u591a\u4e91\u7ba1\u7406\u53ca\u6df7\u5408\u4e91\u878d\u5408\u5e73\u53f0 \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/yunionio\/cloudpods \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u5bfc\u8bfb nsid \u662f CoreDNS \u4e2d\u4e00\u4e2a\u8f7b\u91cf\u4f46\u6781\u5177\u5b9e\u6218\u4ef7\u503c\u7684\u63d2\u4ef6&#xff1a;\u5b83\u5b9e\u73b0 RFC 5001 \u534f\u8bae&#xff0c;\u5728 DNS \u5e94\u7b54\u4e2d\u6ce8\u5165\u4e00\u4e2a EDNS0 OPT \u8d44\u6e90\u8bb0\u5f55&#xff0c;\u7528\u6765\u552f\u4e00\u6807\u8bc6&quot;\u662f\u54ea\u4e00\u53f0\u670d\u52a1\u5668\u751f\u6210\u4e86\u8fd9\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/117881.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-25T11:32:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261025113221-6adde8c563f5f.svg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117881.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/117881.html\",\"name\":\"CoreDNS nsid \u63d2\u4ef6\u5168\u89e3\u6790\uff1a\u57fa\u4e8e RFC 5001 \u7684 DNS \u670d\u52a1\u5668\u6807\u8bc6\u673a\u5236\u4e0e Cloudpods \u96c6\u6210\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-25T11:32:22+00:00\",\"dateModified\":\"2026-10-25T11:32:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/117881.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/117881.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117881.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CoreDNS nsid \u63d2\u4ef6\u5168\u89e3\u6790\uff1a\u57fa\u4e8e RFC 5001 \u7684 DNS \u670d\u52a1\u5668\u6807\u8bc6\u673a\u5236\u4e0e Cloudpods \u96c6\u6210\u5b9e\u8df5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CoreDNS nsid \u63d2\u4ef6\u5168\u89e3\u6790\uff1a\u57fa\u4e8e RFC 5001 \u7684 DNS \u670d\u52a1\u5668\u6807\u8bc6\u673a\u5236\u4e0e Cloudpods \u96c6\u6210\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/117881.html","og_locale":"zh_CN","og_type":"article","og_title":"CoreDNS nsid \u63d2\u4ef6\u5168\u89e3\u6790\uff1a\u57fa\u4e8e RFC 5001 \u7684 DNS \u670d\u52a1\u5668\u6807\u8bc6\u673a\u5236\u4e0e Cloudpods \u96c6\u6210\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u540e\u7aef\u4e91\u539f\u751f\u8fd0\u7ef4\u865a\u62df\u5316\u4eba\u5de5\u667a\u80fdAI \u5e94\u7528 \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011cloudpods \u5f00\u6e90\u3001\u4e91\u539f\u751f\u7684\u591a\u4e91\u7ba1\u7406\u53ca\u6df7\u5408\u4e91\u878d\u5408\u5e73\u53f0 \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/yunionio\/cloudpods \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u5bfc\u8bfb nsid \u662f CoreDNS \u4e2d\u4e00\u4e2a\u8f7b\u91cf\u4f46\u6781\u5177\u5b9e\u6218\u4ef7\u503c\u7684\u63d2\u4ef6&#xff1a;\u5b83\u5b9e\u73b0 RFC 5001 \u534f\u8bae&#xff0c;\u5728 DNS \u5e94\u7b54\u4e2d\u6ce8\u5165\u4e00\u4e2a EDNS0 OPT \u8d44\u6e90\u8bb0\u5f55&#xff0c;\u7528\u6765\u552f\u4e00\u6807\u8bc6\"\u662f\u54ea\u4e00\u53f0\u670d\u52a1\u5668\u751f\u6210\u4e86\u8fd9","og_url":"https:\/\/www.wsisp.com\/helps\/117881.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-25T11:32:22+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261025113221-6adde8c563f5f.svg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/117881.html","url":"https:\/\/www.wsisp.com\/helps\/117881.html","name":"CoreDNS nsid \u63d2\u4ef6\u5168\u89e3\u6790\uff1a\u57fa\u4e8e RFC 5001 \u7684 DNS \u670d\u52a1\u5668\u6807\u8bc6\u673a\u5236\u4e0e Cloudpods \u96c6\u6210\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-25T11:32:22+00:00","dateModified":"2026-10-25T11:32:22+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/117881.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/117881.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/117881.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"CoreDNS nsid \u63d2\u4ef6\u5168\u89e3\u6790\uff1a\u57fa\u4e8e RFC 5001 \u7684 DNS \u670d\u52a1\u5668\u6807\u8bc6\u673a\u5236\u4e0e Cloudpods \u96c6\u6210\u5b9e\u8df5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=117881"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117881\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=117881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=117881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=117881"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=117881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}