{"id":878,"date":"2019-08-05T00:30:33","date_gmt":"2019-08-04T16:30:33","guid":{"rendered":"https:\/\/yangwang.hk\/?p=878"},"modified":"2019-08-18T10:14:00","modified_gmt":"2019-08-18T02:14:00","slug":"dns%e5%8d%8f%e8%ae%ae%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/yangwang.hk\/?p=878","title":{"rendered":"DNS\u534f\u8bae\u8be6\u89e3"},"content":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u662f\u7528Golang\u5b9e\u73b0\u4e00\u4e2aDNS\u670d\u52a1\u5668\u7cfb\u5217\u7b2c\u4e8c\u90e8\u5206\u7684\u4e2d\u7bc7\u3002<\/p>\n<p>\u8fd9\u4e00\u7bc7\u6587\u7ae0\u5c06\u4f1a\u8be6\u7ec6\u7684\u5206\u6790<a href=\"https:\/\/tools.ietf.org\/html\/rfc1035\">RFC1035<\/a>\u6587\u6863\u4e2d\u89c4\u5b9a\u7684DNS\u62a5\u6587\u7684\u683c\u5f0f\u3002\u5bf9\u4e8eDNS\u7684\u6269\u5c55\uff08EDNS0\uff09\u548cDNS\u5b89\u5168\u6269\u5c55\uff08DNSSEC\uff09\uff0c\u5c06\u5728\u672c\u7cfb\u5217\u7b2c\u4e8c\u90e8\u5206\u7684\u4e0b\u7bc7\u4e2d\u8fdb\u884c\u5206\u6790\u3002<\/p>\n<p>DNS\u7684\u8bf7\u6c42\u548c\u54cd\u5e94\u7684\u57fa\u672c\u5355\u4f4d\u662f<strong>DNS\u62a5\u6587<\/strong>\uff08Messgae\uff09\u3002\u8bf7\u6c42\u548c\u54cd\u5e94\u7684DNS\u62a5\u6587\u7ed3\u6784\u662f\u5b8c\u5168\u76f8\u540c\u7684\uff0c\u6bcf\u4e2a\u62a5\u6587\u90fd\u7531\u4ee5\u4e0b\u4e94\u6bb5\uff08Section\uff09\u6784\u6210\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n+---------------------+\r\n|        Header       | \u62a5\u6587\u5934\uff0c\u56fa\u5b9a12\u5b57\u8282\r\n+---------------------+\r\n|       Question      | \u67e5\u8be2\u7684Question\r\n+---------------------+\r\n|        Answer       | Question\u90e8\u5206\u5bf9\u5e94\u7684\u5e94\u7b54\u8bb0\u5f55\r\n+---------------------+\r\n|      Authority      | \u6743\u5a01\u670d\u52a1\u5668\u8d44\u6e90\u8bb0\u5f55\r\n+---------------------+\r\n|      Additional     | \u9644\u52a0\u4fe1\u606f\u8d44\u6e90\u8bb0\u5f55\r\n+---------------------+\r\n<\/pre>\n<p>DNS\u62a5\u6587\u4f7f\u7528<strong>\u7f51\u7edc\u5e8f<\/strong>\uff0c\u5373\u5927\u7aef\u5e8f\u3002\u5f53\u4f7f\u7528X86\uff0carm\u7b49\u5c0f\u7aef\u5e8f(Little-Endian)\u7684CPU\u89e3\u6790\u548c\u751f\u6210\u62a5\u6587\u65f6\uff0c\u5e94\u5f53\u6ce8\u610f\u5b57\u8282\u5e8f\u8f6c\u6362\u7684\u95ee\u9898\u3002<\/p>\n<p>DNS\u6807\u51c6\u4e2d\u4f7f\u7528<strong>Octets<\/strong>(8\u4f4d\u5b57\u8282)\u800c\u4e0d\u662fByte\u4f5c\u4e3a\u5355\u4f4d\uff0c\u8fd9\u662f\u56e0\u4e3a\u5e76\u4e0d\u662f\u6240\u6709\u7684\u8ba1\u7b97\u673a\u90fd\u5c06\u4e00\u5b57\u8282\u8bbe\u8ba1\u62108\u4f4d\uff08\u7279\u522b\u662f\u5728\u5f53\u5e74\uff09\u3002\u4f46\u73b0\u5982\u4eca\u51e0\u4e4e\u6240\u6709\u7684\u8ba1\u7b97\u673a\u90fd\u4f7f\u75288bit=1Byte\u8fd9\u4e2a\u8bbe\u8ba1\uff0c\u65e5\u5e38\u751f\u6d3b\u4e2d\u4e00\u5b57\u82828\u4f4d\u4e5f\u57fa\u672c\u6210\u4e3a\u4e86\u7ea6\u5b9a\u4fd7\u6210\u7684\u6807\u51c6\uff0c\u56e0\u6b64\u672c\u6587\u4f7f\u7528\u5b57\u8282\u8fd9\u4e00\u5355\u4f4d\u4ee5\u7b26\u5408\u7528\u8bed\u4e60\u60ef\u3002<\/p>\n<hr \/>\n<h2>Header\u90e8\u5206<\/h2>\n<p>DNS Header\u662f\u6bcf\u4e2aDNS\u62a5\u6587\u90fd\u5fc5\u987b\u62e5\u6709\u7684\u4e00\u90e8\u5206\uff0c\u5b83\u7684\u957f\u5ea6\u56fa\u5b9a\u4e3a12\u4e2a\u5b57\u8282\uff0c\u5b83\u62e5\u6709\u5982\u4e0b\u7684\u7ed3\u6784\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F\r\n+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n|                      ID                       |\r\n+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n|QR|   Opcode  |AA|TC|RD|RA|   Z    |   RCODE   |\r\n+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n|                    QDCOUNT                    |\r\n+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n|                    ANCOUNT                    |\r\n+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n|                    NSCOUNT                    |\r\n+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n|                    ARCOUNT                    |\r\n+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n\r\n<\/pre>\n<h4>ID<\/h4>\n<p>ID\u662f\u4e00\u4e2a16bit\u957f\u6807\u8bc6\u7b26\uff0c\u53ef\u4ee5\u7406\u89e3\u4e3a\u4e00\u4e2a2\u5b57\u8282\u7684\u65e0\u7b26\u53f7\u6570\u3002\u8be5\u5b57\u6bb5\u7531\u53d1\u8d77\u67e5\u8be2\u8bf7\u6c42\u7684\u5ba2\u6237\u7aef\u751f\u6210\u3002\u670d\u52a1\u7aef\u5728\u751f\u6210\u54cd\u5e94\u62a5\u6587\u65f6\u4f1a\u539f\u6837\u590d\u5236\u8fd9\u4e2a\u503c\uff0c\u8fd9\u610f\u5473\u7740\u76f8\u540cID\u7684\u8bf7\u6c42\u548c\u54cd\u5e94\u62a5\u6587\u662f\u4e00\u5bf9\u8bf7\u6c42\u3002\u56e0\u6b64\u5ba2\u6237\u7aef\u53ef\u4ee5\u6839\u636e\u8fd9\u4e2a\u5b57\u6bb5\u5f97\u77e5\u67d0\u4e2a\u54cd\u5e94\u62a5\u6587\u5bf9\u5e94\u7684\u662f\u54ea\u6b21\u67e5\u8be2\u8bf7\u6c42\u3002<\/p>\n<h4>QR<\/h4>\n<p>QR\u662f1bit flag\u4f4d\uff0c\u503c\u4e3a0\u8868\u793a\u8fd9\u662f\u4e00\u6b21\u67e5\u8be2\uff0c1\u5219\u8868\u793a\u8be5\u62a5\u6587\u662f\u54cd\u5e94\u62a5\u6587\u3002<\/p>\n<h4>Opcode<\/h4>\n<p>4bit\u957f\u7684\u67e5\u8be2\u7c7b\u578b\u5b57\u6bb5\uff0c\u8fd9\u4e2a\u503c\u7531\u67e5\u8be2\u53d1\u8d77\u8005\u8bbe\u7f6e\uff0c\u5728\u54cd\u5e94\u65f6\u539f\u6837\u590d\u5236\uff0c\u6211\u4eec\u4e3b\u8981\u4f7f\u7528Query\u67e5\u8be2\uff0c\u5176\u5b83\u51e0\u79cd\u57fa\u672c\u89c1\u4e0d\u5230\u3002<\/p>\n<table id=\"table-dns-parameters-5\" class=\"sortable\" style=\"width: 100%; height: 192px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"height: 24px;\" align=\"center\">0<\/td>\n<td style=\"height: 24px;\">Query\uff08\u6700\u5e38\u7528\u7684\u67e5\u8be2\uff09<\/td>\n<td style=\"height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"height: 24px;\" align=\"center\">1<\/td>\n<td style=\"height: 24px;\">IQuery (\u53cd\u5411\u67e5\u8be2\uff0c\u73b0\u5728\u5df2\u7ecf\u4e0d\u518d\u4f7f\u7528\u4e86)<\/td>\n<td style=\"height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc3425\">RFC3425<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"height: 24px;\" align=\"center\">2<\/td>\n<td style=\"height: 24px;\">Status<\/td>\n<td style=\"height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"height: 24px;\" align=\"center\">3<\/td>\n<td style=\"height: 24px;\">\u672a\u6307\u5b9a<\/td>\n<td style=\"height: 24px;\"><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"height: 24px;\" align=\"center\">4<\/td>\n<td style=\"height: 24px;\">Notify<\/td>\n<td style=\"height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1996\">RFC1996<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"height: 24px;\" align=\"center\">5<\/td>\n<td style=\"height: 24px;\">Update<\/td>\n<td style=\"height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc2136\">RFC2136<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"height: 24px;\" align=\"center\">6<\/td>\n<td style=\"height: 24px;\">DNS Stateful Operations (DSO)<\/td>\n<td style=\"height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc8490\">RFC8490<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"height: 24px;\" align=\"center\">7-15<\/td>\n<td style=\"height: 24px;\">\u672a\u6307\u5b9a<\/td>\n<td style=\"height: 24px;\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 class=\"newpage\">AA(Authoritative Answer)\u6743\u5a01\u5e94\u7b54\u6807\u5fd7\u4f4d<\/h4>\n<p>1bit\u6743\u5a01\u5e94\u7b54\u6807\u8bb0\uff0c\u5f53\u54cd\u5e94\u62a5\u6587\u7531\u6743\u5a01\u670d\u52a1\u5668\u53d1\u51fa\u65f6\uff0c\u8be5\u4f4d\u7f6e1\uff0c\u5426\u5219\u4e3a0\u3002<\/p>\n<h4>TC(TrunCation)\u622a\u65ad\u6807\u5fd7\u4f4d<\/h4>\n<p>\u5f53\u4f7f\u7528UDP\u4f20\u8f93\u65f6\uff0c\u82e5\u54cd\u5e94\u6570\u636e\u8d85\u8fc7DNS\u6807\u51c6\u9650\u5236\uff08\u8d85\u8fc7512B\uff09\uff0c\u6570\u636e\u5305\u4fbf\u4f1a\u53d1\u751f\u622a\u65ad\uff0c\u8d85\u51fa\u90e8\u5206\u88ab\u4e22\u5f03\uff0c\u6b64\u65f6\u8be5flag\u4f4d\u88ab\u7f6e1\u3002<\/p>\n<p>\u5f53\u5ba2\u6237\u7aef\u53d1\u73b0TC\u4f4d\u88ab\u7f6e1\u7684\u54cd\u5e94\u6570\u636e\u5305\u65f6\u5e94\u8be5\u9009\u62e9\u4f7f\u7528TCP\u91cd\u65b0\u53d1\u9001\u67e5\u8be2\u3002\u56e0\u4e3aTCP DNS\u62a5\u6587\u4e0d\u53d7512\u5b57\u8282\u9650\u5236\u3002<\/p>\n<h4>RD(Recursion Desired)\u9012\u5f52\u67e5\u8be2\u671f\u671b\u6807\u5fd7\u4f4d<\/h4>\n<p>\u5ba2\u6237\u7aef\u5e0c\u671b\u670d\u52a1\u5668\u5bf9\u6b64\u6b21\u67e5\u8be2\u8fdb\u884c\u9012\u5f52\u67e5\u8be2\u65f6\u5c06\u8be5\u4f4d\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002\u54cd\u5e94\u65f6RD\u4f4d\u4f1a\u590d\u5236\u5230\u54cd\u5e94\u62a5\u6587\u5185\u3002<\/p>\n<h4>RA(Recursion Available)\u9012\u5f52\u67e5\u8be2\u53ef\u7528\u6807\u5fd7\u4f4d<\/h4>\n<p>\u670d\u52a1\u5668\u6839\u636e\u81ea\u5df1\u662f\u5426\u652f\u6301\u9012\u5f52\u67e5\u8be2\u5bf9\u8be5\u4f4d\u8fdb\u884c\u8bbe\u7f6e\u30021\u4e3a\u652f\u6301\u9012\u5f52\u67e5\u8be2\uff0c0\u4e3a\u4e0d\u652f\u6301\u9012\u5f52\u67e5\u8be2\u3002<\/p>\n<h4>Z \u4fdd\u7559\u6bb5<\/h4>\n<p>\u8fd9\u4e09\u4e2abit\u672a\u5728<a href=\"https:\/\/tools.ietf.org\/html\/rfc1035\">RFC1035<\/a>\u4e2d\u6307\u5b9a\u7528\u9014\uff0c\u4fdd\u7559\u5230\u4ee5\u540e\u5347\u7ea7\u65f6\u4f7f\u7528\u3002<\/p>\n<h4>RCODE(Response Code)\u54cd\u5e94\u7801<\/h4>\n<p>\u8fd9\u4e2a\u5b57\u6bb5\u5728\u54cd\u5e94\u65f6\u8fdb\u884c\u8bbe\u7f6e\uff1a<\/p>\n<table id=\"table-dns-parameters-6\" class=\"sortable\" style=\"width: 100%;\">\n<thead>\n<tr>\n<th style=\"width: 22.9323%;\">RCODE<\/th>\n<th style=\"width: 119.925%;\"><\/th>\n<th style=\"width: 122.18%;\">Reference<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"width: 22.9323%;\" align=\"center\">0<\/td>\n<td style=\"width: 119.925%;\">\u6ca1\u6709\u9519\u8bef\u3002<\/td>\n<td style=\"width: 122.18%;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 22.9323%;\" align=\"center\">1<\/td>\n<td style=\"width: 119.925%;\">Format error\uff1a\u683c\u5f0f\u9519\u8bef\uff0c\u670d\u52a1\u5668\u4e0d\u80fd\u7406\u89e3\u8bf7\u6c42\u7684\u62a5\u6587\u683c\u5f0f\u3002<\/td>\n<td style=\"width: 122.18%;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 22.9323%;\" align=\"center\">2<\/td>\n<td style=\"width: 119.925%;\">Server failure\uff1a\u670d\u52a1\u5668\u5931\u8d25\uff0c\u56e0\u4e3a\u670d\u52a1\u5668\u7684\u539f\u56e0\u5bfc\u81f4\u6ca1\u529e\u6cd5\u5904\u7406\u8fd9\u4e2a\u8bf7\u6c42\u3002<\/td>\n<td style=\"width: 122.18%;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 22.9323%;\" align=\"center\">3<\/td>\n<td style=\"width: 119.925%;\">Name Error\uff1a\u540d\u5b57\u9519\u8bef\uff0c\u8be5\u503c\u53ea\u5bf9\u6743\u5a01\u5e94\u7b54\u6709\u610f\u4e49\uff0c\u5b83\u8868\u793a\u8bf7\u6c42\u7684\u57df\u540d\u4e0d\u5b58\u5728\u3002<\/td>\n<td style=\"width: 122.18%;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 22.9323%;\" align=\"center\">4<\/td>\n<td style=\"width: 119.925%;\">Not Implemented\uff1a\u672a\u5b9e\u73b0\uff0c\u57df\u540d\u670d\u52a1\u5668\u4e0d\u652f\u6301\u8be5\u67e5\u8be2\u7c7b\u578b\u3002<\/td>\n<td style=\"width: 122.18%;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 22.9323%;\" align=\"center\">5<\/td>\n<td style=\"width: 119.925%;\">Refused\uff1a\u62d2\u7edd\u670d\u52a1\uff0c\u670d\u52a1\u5668\u7531\u4e8e\u8bbe\u7f6e\u7684\u7b56\u7565\u62d2\u7edd\u7ed9\u51fa\u5e94\u7b54\u3002\u6bd4\u5982\uff0c\u670d\u52a1\u5668\u4e0d\u5e0c\u671b\u5bf9\u4e2a\u8bf7\u6c42\u8005\u7ed9\u51fa\u5e94\u7b54\u65f6\u53ef\u4ee5\u4f7f\u7528\u6b64\u54cd\u5e94\u7801\u3002<\/td>\n<td style=\"width: 122.18%;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5728<a href=\"https:\/\/tools.ietf.org\/html\/rfc1035\">RFC1035<\/a>\u4e2d\uff0c6-15\u7684RCODE\u672a\u88ab\u6307\u6d3e\u3002\u5728\u540e\u671fIETF\u65b0\u6307\u5b9a\u4e86\u8bb8\u591aRCODE\uff0c\u540c\u65f6\u5728EDNS0\u5185\uff0c\u8be5\u5b57\u6bb5\u88ab\u6269\u5c55\u81f3\u4e8612bit\uff0c\u8fd9\u610f\u5473\u7740\u54cd\u5e94\u7801\u7684\u6570\u91cf\u753116\u5347\u81f3\u4e864096\u3002\u8be6\u7ec6\u5b8c\u6574\u7684\u503c\u4e0e\u542b\u4e49\u53ef\u4ee5\u8bbf\u95ee<a href=\"https:\/\/www.iana.org\/assignments\/dns-parameters\/dns-parameters.xhtml#dns-parameters-6\">\u8fd9\u91cc\u67e5\u770b<\/a>\u3002<\/p>\n<h4>QDCOUNT\uff0cANCOUNT\uff0cNSCOUNT\uff0cARCOUNT<\/h4>\n<p>\u8fd9\u56db\u4e2a\u5b57\u6bb5\u90fd\u662f\u4e00\u4e2a16bit\u65e0\u7b26\u53f7\u6574\u6570\uff0c\u5206\u522b\u8868\u793a\u540e\u9762\u56db\u4e2a\u6570\u636e\u6bb5\u5185\u6761\u76ee\u7684\u4e2a\u6570\u3002<\/p>\n<hr \/>\n<h2>Question\u6bb5<\/h2>\n<p>question\u90e8\u5206\u5b58\u653e\u7684\u662f\u5411\u670d\u52a1\u5668\u67e5\u8be2\u7684\u57df\u540d\u6570\u636e\u3002\u5b83\u7531<strong>QDCOUNT<\/strong>\u4e2a\u201c<strong>\u6761\u76ee<\/strong>\u201d(Entry)\u7ec4\u6210\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\u5b83\u53ea\u6709\u4e00\u6761Entry\u3002<\/p>\n<p>\u6bcf\u4e2aEntry\u7684\u683c\u5f0f\u662f\u76f8\u540c\u7684\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n      0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                                               |\r\n    \/                     QNAME                     \/\r\n    \/                                               \/\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                     QTYPE                     |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                     QCLASS                    |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n<\/pre>\n<h4>QNAME<\/h4>\n<p>\u7531labels\u5e8f\u5217\u6784\u6210\u7684\u57df\u540d\u3002QNAME\u7684\u683c\u5f0f\u4f7f\u7528<a href=\"#DNSStandardNameNotation\">DNS\u6807\u51c6\u540d\u79f0\u8868\u793a\u6cd5<\/a>\u3002\u8fd9\u4e2a\u5b57\u6bb5\u662f\u53d8\u957f\u7684\uff0c\u56e0\u6b64\u6709\u53ef\u80fd\u51fa\u73b0\u5947\u6570\u4e2a\u5b57\u8282\uff0c\u4f46\u4e0d\u8fdb\u884c\u8865\u9f50\u3002<\/p>\n<h4>QTYPE<\/h4>\n<p>\u57df\u540d\u7684\u8d44\u6e90\u7c7b\u578b\uff0c\u957f\u5ea6\u662f\u4e24\u4e2a\u5b57\u8282\u3002\u6211\u4eec\u5728\u8bbe\u7f6e\u57df\u540d\u7684\u89e3\u6790\u65f6\u7684A\u8bb0\u5f55\uff0cTXT\u8bb0\u5f55\u5c31\u662f\u8fd9\u91cc\u4f7f\u7528\u7684\u7c7b\u578b\u3002\u8be5\u5b57\u6bb5\u7684\u53d6\u503c\u5305\u542b\u6240\u6709\u540e\u6587\u63d0\u5230\u7684<strong>\u8d44\u6e90\u8bb0\u5f55<\/strong>TYPE\u5b57\u6bb5\u53d6\u503c\uff0c\u540c\u65f6\u8fd8\u6709\u51e0\u4e2a\u989d\u5916\u7684\u503c\u7528\u4e8e\u8868\u793a\u53d6\u56de\u591a\u4e2a\u7c7b\u578b\u7684TYPE\u3002<\/p>\n<p>\u5e38\u7528\u7684TYPE\u548c\u5176\u5bf9\u5e94\u7684\u542b\u4e49\u5728\u672c\u6587\u7684<a href=\"#RRType\">RR Type<\/a>\u5904\u4ecb\u7ecd\u3002\u5b8c\u6574\u7684\u5217\u8868\u53ef\u4ee5\u8bbf\u95ee<a href=\"https:\/\/www.iana.org\/assignments\/dns-parameters\/dns-parameters.xhtml#dns-parameters-4\">https:\/\/www.iana.org\/<\/a>\u83b7\u53d6\u3002<\/p>\n<h4>QCLASS<\/h4>\n<p>\u4e24\u5b57\u8282\u957f\u7684\u8bf7\u6c42\u7684\u7c7b\u578b\uff0c\u4e92\u8054\u7f51\u8bf7\u6c42\u65f6\u503c\u4e3a\u201cIN\u201d\uff0c\u5bf9\u5e94\u503c\u4e3a<code>0x0001<\/code>\uff0c\u8fd9\u5e74\u5934\u5e94\u8be5\u4e5f\u89c1\u4e0d\u5230\u5176\u4ed6\u7684CLASS\u7c7b\u578b\u3002\u5177\u4f53\u7684CLASS\u7c7b\u578b\u53ef\u4ee5\u8bbf\u95ee<a href=\"https:\/\/www.iana.org\/assignments\/dns-parameters\/dns-parameters.xhtml#dns-parameters-2\">https:\/\/www.iana.org<\/a>\u83b7\u53d6<\/p>\n<h2><a id=\"DNSStandardNameNotation\"><\/a>DNS\u6807\u51c6\u540d\u79f0\u8868\u793a\u6cd5<\/h2>\n<p>\u4e0d\u8bba\u662fQuestion\u5185\u8fd8\u662f\u540e\u9762\u7684\u5176\u4ed6\u4e09\u4e2a\u6bb5\u5185\uff0cDNS\u4f7f\u7528\u4e00\u79cd\u6807\u51c6\u683c\u5f0f\u5bf9\u57df\u540d\u8fdb\u884c\u7f16\u7801\u3002\u5b83\u7531\u4e00\u7cfb\u5217\u7684<strong>label<\/strong>\uff08\u548c\u57df\u540d\u4e2d\u7528.\u5206\u5272\u7684label\u4e0d\u540c\uff09\u6784\u6210\u3002\u6bcf\u4e2alebel\u9996\u5b57\u8282\u7684\u9ad8\u4e24\u4f4d\u7528\u4e8e\u8868\u793alabel\u7684\u7c7b\u578b\u3002\u8fd9\u610f\u5473\u7740\u4e00\u5171\u53ef\u76f4\u63a5\u5206\u914d\u56db\u79cdlabel\u7c7b\u578b\u3002RFC1035\u4e2d\u5206\u914d\u4e86\u56db\u4e2a\u91cc\u9762\u7684\u4e24\u4e2a\uff0c\u5206\u522b\u662f\uff1a<strong>00<\/strong>\u8868\u793a\u7684\u666e\u901alabel\uff0c<strong>11<\/strong>\u8868\u793a\u7684\u538b\u7f29label\u3002<\/p>\n<h4>\u666e\u901alabel(0b00xxxxxx)<\/h4>\n<p>\u5f53label\u9996\u5b57\u8282\u7684\u9ad8\u4e24\u4f4d\u4e3a0\u65f6\uff0c\u8868\u793a\u8fd9\u662f\u4e00\u4e2a\u666e\u901alabel\u3002\u6b64\u65f6\u4f7f\u7528\u8be5\u5b57\u8282\u5269\u4e0b\u76846bit\uff08\u4e5f\u5c31\u662fxxxxxx\u90e8\u5206\uff09\u8868\u793a\u8be5label\u540e\u7eed\u7684\u957f\u5ea6\u3002<\/p>\n<p>\u540e\u9762\u7684\u90e8\u5206\u548c\u57df\u540d\u7684\u90a3\u4e2alabel\u5b8c\u5168\u76f8\u540c\u3002\u4f8b\u5982www.example.com\u4e2d\u7b2c\u4e00\u4e2alabel www \u4f7f\u7528\u666e\u901alabel\u7f16\u7801\u65f6\u4f1a\u5f97\u5230\u4e8c\u8fdb\u5236\u5e8f\u5217\uff1a<code><strong>[0x03]['w']['w']['w']<\/strong><\/code><\/p>\n<p>\u7531\u4e8e\u6240\u6709\u57df\u540d\u6700\u540e\u90fd\u4f1a\u6709\u4e00\u4e2a\u957f\u5ea6\u4e3a0\u7684\u6839\u57df\u540d\uff0c\u56e0\u6b64\u8be5\u7f16\u7801\u4e0b\u4fbf\u4f1a\u6709\u4e2a\u503c\u4e3a<code>0x00<\/code>\u7684label\u6765\u6807\u8bc6\u57df\u540d\u672b\u5c3e\u3002<\/p>\n<p><code>www.example.com<\/code>\u7684\u5b8c\u6574\u7f16\u7801\u662f\u201c<code>[3]www[7]example[3]com[0]<\/code>&#8220;\uff0c\u753b\u4e2a\u56fe\u7684\u8bdd\u5c31\u662f\uff1a<\/p>\n<p><a href=\"https:\/\/yangwang.hk\/?attachment_id=895\" rel=\"attachment wp-att-895\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-895 size-large\" src=\"https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53484.14.47-1024x242.png\" alt=\"\" width=\"665\" height=\"157\" srcset=\"https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53484.14.47-1024x242.png 1024w, https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53484.14.47-300x71.png 300w, https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53484.14.47-768x181.png 768w, https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53484.14.47-660x156.png 660w, https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53484.14.47.png 1532w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/a><\/p>\n<p>\u7531\u4e8e\u6807\u8bc6\u957f\u5ea6\u7684\u90e8\u5206\u53ea\u67096bit\uff0c\u56e0\u6b64\u5b83\u7684\u53d6\u503c\u8303\u56f4\u5c31\u6210\u4e860x00-0x3f\uff080-63\uff09\uff0c\u6362\u53e5\u8bdd\u8bf4\uff0c\u57df\u540d\u7684\u4e00\u4e2alabel\u6700\u957f\u4e3a63\u4e2a\u5b57\u8282\u3002<\/p>\n<h4>\u538b\u7f29label(0b11xxxxxx)<\/h4>\n<p>\u7531\u4e8e\u4e00\u4e2aDNS\u62a5\u6587\u5185\u5f80\u5f80\u62e5\u6709\u591a\u4e2a\u57df\u540d\uff0c\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u8fd9\u4e9b\u57df\u540d\u6709\u4e00\u90e8\u5206\u662f\u5b8c\u5168\u76f8\u540c\u7684\u3002\u6bd4\u598213\u4e2a\u6839\u57df\u540d\u670d\u52a1\u5668\u5730\u5740\u7684\u552f\u4e00\u7684\u533a\u522b\u662f\u4e09\u7ea7\u57df\u540d\u7531a\u7f16\u53f7\u81f3m\uff0c\u540e\u9762\u768415\u4e2a\u5b57\u8282\u7684label\u5b8c\u5168\u76f8\u540c\uff08<code>.root-servers.net<\/code>\uff09\u3002\u5982\u679c\u6240\u6709\u57df\u540d\u90fd\u6309\u7167\u4e0a\u8ff0\u65b9\u6cd5\u539f\u6837\u8868\u793a\uff0c\u90a3\u4e48\u4f1a\u56e0\u4e3a\u5197\u4f59\u6570\u636e\u6d6a\u8d39\u8bb8\u591a\u7a7a\u95f4\u3002\u4e3a\u6b64\uff0c\u6807\u51c6\u89c4\u5b9a\u4e86\u4e00\u79cd\u9488\u5bf9\u57df\u540d\u7684\u538b\u7f29\u8868\u793a\u6cd5\uff0c\u5373\u4f7f\u7528\u4e00\u4e2a<strong>\u538b\u7f29\u6307\u9488<\/strong>\u6765\u5bf9\u57df\u540d\u6570\u636e\u8fdb\u884c\u590d\u7528\u3002\u751f\u6210\u62a5\u6587\u65f6\u538b\u7f29\u5e76\u4e0d\u662f\u5f3a\u5236\u89c4\u5b9a\u5fc5\u987b\u5b9e\u73b0\u7684\u3002<\/p>\n<p>label\u9996\u5b57\u8282\u7684\u9ad8\u4e24\u4f4d\u4e3a11\u65f6\u8868\u793a\u8fd9\u4e2alabel\u662f\u538b\u7f29\u8868\u793a\u7684\uff0c\u5373\u4e3a\u4e00\u4e2a\u538b\u7f29\u6307\u9488\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5f53\u4f60\u53d1\u73b0\u67d0\u4e2alabel\u9996\u5b57\u8282\u7684\u503c\u5927\u4e8e\u7b49\u4e8e0xc0(\u5341\u8fdb\u5236\u7684192)\u65f6\uff0c\u8bf4\u660e\u8fd9\u662f\u4e00\u4e2a\u6307\u9488\u3002<\/p>\n<p>\u538b\u7f29\u6307\u9488\u957f\u4e24\u5b57\u8282\uff0c\u6307\u9488\u7684\u503c\u662f\u7b2c\u4e00\u4e2a\u5b57\u8282\u7684\u4f4e\u516d\u4f4d\u548c\u7b2c\u4e8c\u4e2a\u5b57\u8282\uff0c\u4e00\u517114\u4f4d\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    | 1  1|                OFFSET                   |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n<\/pre>\n<p><strong>OFFSET<\/strong>\u4fbf\u662f\u6307\u9488\uff0c\u8fd9\u4e2aOFFSET\u8868\u793alabel\u7684\u771f\u5b9e\u6570\u636e\u4f4d\u4e8e\u6574\u4e2a\u6570\u636e\u5305\u7684offset\u5904\u3002\u548c\u6570\u7ec4\u4e0b\u6807\u7c7b\u4f3c\uff0c\u6570\u636e\u5305\u7684\u7b2c\u4e00\u4e2a\u5b57\u8282offset\u4e3a0\u3002<\/p>\n<p>\u8fd9\u4e48\u8bf4\u53ef\u80fd\u8fd8\u662f\u4e91\u91cc\u96fe\u91cc\uff0c\u6765\u4e2a\u4f8b\u5b50\u5c31\u660e\u767d\u4e86\uff0c\u4e0b\u9762\u662f\u4e00\u4e2a\u771f\u5b9eDNS\u6570\u636e\u5305\u770b\u8d77\u6765\u7684\u6837\u5b50\uff1a<\/p>\n<p><a href=\"https:\/\/yangwang.hk\/?attachment_id=896\" rel=\"attachment wp-att-896\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-896\" src=\"https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53485.54.25-1024x227.png\" alt=\"DNS\u538b\u7f29\u6307\u9488\" width=\"665\" height=\"147\" srcset=\"https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53485.54.25-1024x227.png 1024w, https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53485.54.25-300x67.png 300w, https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53485.54.25-768x170.png 768w, https:\/\/yangwang.hk\/wp-content\/uploads\/2019\/08\/\u5c4f\u5e55\u5feb\u7167-2019-08-06-\u4e0b\u53485.54.25-660x146.png 660w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/a><\/p>\n<p>\u5047\u8bbe\u67d0\u4e2a\u62a5\u6587\u4f9d\u6b21\u5728\u6570\u636e\u5305\u76840x0C\uff0c0x2E\u548c0x4C\u5904\u4f9d\u6b21\u51fa\u73b0\u4e86\u4e09\u6761\u57df\u540d\uff1a<code>example.com<\/code>\uff0c<code>www.example.com<\/code>\uff0c<code>www.example.com<\/code>\u3002\u7531\u4e8e\u540e\u4e24\u6761\u57df\u540d\u7684<code>example.com<\/code>\u90e8\u5206\u4e0e\u7b2c\u4e00\u6761\u76f8\u540c\uff0c\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528\u538b\u7f29\u6307\u9488\u8fdb\u884c\u538b\u7f29\u3002<\/p>\n<p>\u5bf9\u4e8e\u7b2c\u4e8c\u6761\u57df\u540d\uff0c\u7b2c\u4e00\u4e2alabel <code>www<\/code>\u5e76\u672a\u5728\u4ee5\u524d\u57df\u540d\u4e2d\u51fa\u73b0\uff0c\u56e0\u6b64\u7b2c\u4e00\u4e2alabel\u9700\u8981\u76f4\u63a5\u7ed9\u51fa\uff0c\u4ece\u7b2c\u4e8c\u4e2alabel\u8d77\uff0cexample.com\u5df2\u7ecf\u5728\u6570\u636e\u53050x0C\u5904\u6709\u4e86\u4e00\u4efd\uff0c\u56e0\u6b64\u6784\u9020\u6307\u9488<code>0xC00C<\/code>(0b11000000 00001100)\uff0c\u6700\u9ad8\u4e24bit\u8868\u793a\u8fd9\u662f\u4e00\u4e2a\u6307\u9488\uff0c\u540e14bit\u6307\u5b9a\u4e86\u63a5\u4e0b\u6765\u7684label\u4f4d\u4e8e\u6574\u4e2a\u62a5\u6587\u7684\u504f\u79fb\u91cf\uff08\u7b2c\u4e00\u4e2a\u5b57\u8282\u504f\u79fb\u91cf\u662f0\uff09\uff0c\u4e5f\u5c31\u662f0C\u3002<\/p>\n<p>\u7b2c\u4e09\u6761\u57df\u540d\u540c\u7406\uff0c\u4e0d\u8fc7\u76f8\u540c\u7684\u90e8\u5206\u53d8\u6210\u4e86\u6574\u4e2a\u57df\u540d\uff0c\u56e0\u6b64\u76f4\u63a5\u63d0\u4f9b\u6307\u9488\u5373\u53ef\u3002\u538b\u7f29\u662f\u53ef\u4ee5\u5d4c\u5957\u7684\uff0c\u6bd4\u5982\u8fd9\u91cc\u538b\u7f29\u6307\u94880xC02E\u6307\u5411\u7684\u662f\u7b2c\u4e8c\u6761\u57df\u540d\uff0c\u800c\u7b2c\u4e8c\u6761\u57df\u540d\u672c\u8eab\u4e5f\u4f7f\u7528\u4e86\u538b\u7f29\u3002<\/p>\n<p>\u538b\u7f29\u6307\u9488\u7684\u542b\u4e49\u662f\uff0c\u5f53\u524d\u57df\u540d\u7684label\u5e8f\u5217\u4ece\u6b64label\u5f00\u59cb\uff0c\u4e0e\u6307\u9488\u6307\u5411\u7684label\u5e8f\u5217\u662f\u76f8\u540c\u7684\u3002\u5f88\u663e\u7136\u538b\u7f29\u7ed3\u679c\u4e0d\u662f\u552f\u4e00\u7684\uff0c\u6bd4\u5982\u7b2c\u4e09\u6761\u57df\u540d\u4e5f\u53ef\u4ee5\u538b\u7f29\u6210<code>[0x03]www[0xc0][0x0c]<\/code>\u3002\u4f7f\u7528\u538b\u7f29\u6307\u9488\u4e4b\u540e\uff0c\u5c31\u4e0d\u7528\u5728\u6307\u9488\u6700\u540e\u52a0\u4e00\u4e2a0x00\u8868\u793a\u540d\u79f0\u7ed3\u675f\u4e86\uff0c\u56e0\u4e3a\u987a\u7740\u6307\u9488\u627e\u4e0b\u53bb\u603b\u80fd\u627e\u5230\u8868\u793a\u672b\u5c3e\u76840\u3002<\/p>\n<p>\u4e00\u4e2a\u540d\u79f0\u5185\u6700\u591a\u4f7f\u7528\u4e00\u4e2a\u538b\u7f29\u6307\u9488\uff0c\u6362\u53e5\u8bdd\u8bf4\uff0c\u4e00\u4e2a\u540d\u79f0\u53ea\u6709\u4e00\u4e0b\u4e09\u79cd\u5f62\u5f0f\uff1a<\/p>\n<ol>\n<li>\u4e00\u5806label\u5e8f\u5217\uff0c\u800c\u4e14\u672b\u5c3e\u4f7f\u7528\u4e00\u5b57\u82820x00\u6807\u8bc6\u7ed3\u675f<\/li>\n<li>\u4e00\u4e2a\u538b\u7f29\u6307\u9488<\/li>\n<li>\u4e00\u5806label\u5e8f\u5217\uff0c\u6700\u540e\u8ddf\u4e00\u4e2a\u538b\u7f29\u6307\u9488<\/li>\n<\/ol>\n<h4>\u90ae\u4ef6\u540d<\/h4>\n<p>\u6709\u65f6\u5019\u9700\u8981\u5728\u4e00\u4e2a\u5b57\u6bb5\u5185\u8868\u793a\u4e00\u4e2a\u7535\u5b50\u90ae\u4ef6\u5730\u5740\uff0c\u6211\u4eec\u77e5\u9053\u90ae\u4ef6\u5730\u5740\u7684\u683c\u5f0f\u662f<code><span style=\"font-family: Arial;\">&lt;name&gt;@&lt;domain-name&gt;<\/span><\/code>\uff0c\u4e3a\u4e86\u80fd\u65b9\u4fbf\u590d\u7528\uff0cDNS\u5185\u5c06@\u5b57\u7b26\u66ff\u6362\u4e3a\u4e00\u4e2a&#8221;.&#8221;\uff0c\u5982\u6b64\u4fbf\u80fd\u6cbf\u7528\u4e0a\u9762\u57df\u540d\u7684\u8868\u793a\u65b9\u6cd5\u3002\u4f8b\u5982<code>admin@example.com<\/code>\u4f7f\u7528\u540d\u79f0\u8868\u793a\u6cd5\u540e\u7ed3\u679c\u7b49\u540c\u4e8e<code>admin.example.com<\/code>\u3002<\/p>\n<hr \/>\n<h2>Answer\uff0cAuthority\uff0cAdditional\u6bb5<\/h2>\n<p><strong>Answer<\/strong>\uff0c<strong>Authority<\/strong>\u548c<strong>Additional<\/strong>\u4e09\u4e2a\u6bb5\u7684\u683c\u5f0f\u662f\u5b8c\u5168\u76f8\u540c\u7684\uff0c\u90fd\u662f\u7531\u96f6\u81f3\u591a\u6761<strong>Resource Record\uff08\u8d44\u6e90\u8bb0\u5f55\uff09<\/strong>\u6784\u6210\u3002\u8fd9\u4e9b\u8d44\u6e90\u8bb0\u5f55\u56e0\u4e3a\u4e0d\u540c\u7684\u7528\u9014\u800c\u88ab\u5206\u5f00\u5b58\u653e\u3002<\/p>\n<p>Answer\u5bf9\u5e94\u67e5\u8be2\u8bf7\u6c42\u4e2d\u7684Question\uff0cQuestion\u4e2d\u7684\u8bf7\u6c42\u67e5\u8be2\u7ed3\u679c\u4f1a\u5728Answer\u4e2d\u7ed9\u51fa\uff0c\u5982\u679c\u4e00\u4e2a\u54cd\u5e94\u62a5\u6587\u7684Answer\u4e3a\u7a7a\uff0c\u8bf4\u660e\u8fd9\u6b21\u67e5\u8be2\u6ca1\u6709<strong>\u76f4\u63a5<\/strong>\u83b7\u5f97\u7ed3\u679c\u3002<\/p>\n<p>Authority\u5305\u542b\u7684\u662f\u6743\u5a01\u670d\u52a1\u5668\u4fe1\u606f\uff0c\u5982\u679c\u67d0\u6b21\u67e5\u8be2\u7ed3\u679c\u91ccAnswer\u90e8\u5206\u4e3a\u7a7a\uff0c\u90a3\u4e48\u4f60\u53ef\u80fd\u9700\u8981\u6839\u636eAuthority\u5185\u7684\u5185\u5bb9\u7ee7\u7eed\u53d1\u8d77\u67e5\u8be2\u8bf7\u6c42\u3002<\/p>\n<p>Additional\u8fd9\u4e2a\u540d\u5b57\u770b\u8d77\u6765\u5c31\u5f88\u9644\u52a0\uff0c\u524d\u9762\u4e09\u4e2a\u6bb5\u653e\u4e0d\u4e86\u7684\u4fe1\u606f\u5f80\u91cc\u5934\u65e0\u8111\u585e\u5c31\u5b8c\u4e8b\u513f\u4e86\u3002\u8fd9\u4e2a\u6bb5\u4f1a\u5728EDNS\u4e2d\u88ab\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u5728\u8fd9\u91cc\u5305\u542bAuthority\u4e2d\u57df\u540d\u670d\u52a1\u5668\u7684\u5177\u4f53IP\u5730\u5740\uff0c\u8fd9\u6837\u4fbf\u53ef\u4ee5\u51cf\u5c11\u4e00\u6b21\u67e5\u8be2\u57df\u540d\u670d\u52a1\u5668\u5730\u5740\u7684\u8bf7\u6c42\u3002<\/p>\n<h2>RR(Resource Record)\u8d44\u6e90\u8bb0\u5f55<\/h2>\n<p>\u8d44\u6e90\u8bb0\u5f55\u662fDNS\u7cfb\u7edf\u4e2d\u975e\u5e38\u91cd\u8981\u7684\u4e00\u90e8\u5206\uff0c\u5b83\u62e5\u6709\u4e00\u4e2a\u53d8\u957f\u7684\u7ed3\u6784\uff0c\u5177\u4f53\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n      0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                                               |\r\n    \/                                               \/\r\n    \/                      NAME                     \/\r\n    |                                               |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                      TYPE                     |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                     CLASS                     |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                      TTL                      |\r\n    |                                               |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                    RDLENGTH                   |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|\r\n    \/                     RDATA                     \/\r\n    \/                                               \/\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n<\/pre>\n<h4>NAME<\/h4>\n<p>\u5b83\u6307\u5b9a\u8be5\u6761\u8bb0\u5f55\u5bf9\u5e94\u7684\u662f\u54ea\u4e2a\u57df\u540d\uff0c\u683c\u5f0f\u4f7f\u7528<a href=\"#DNSStandardNameNotation\">DNS\u6807\u51c6\u540d\u79f0\u8868\u793a\u6cd5<\/a><\/p>\n<h4>TYPE<\/h4>\n<p>\u8d44\u6e90\u8bb0\u5f55\u7684\u7c7b\u578b\uff0c\u5728\u672c\u6587\u7684<a href=\"#RRType\">RR Type<\/a>\u90e8\u5206\u8fdb\u884c\u5177\u4f53\u4ecb\u7ecd\u3002<\/p>\n<h4>CLASS<\/h4>\n<p>\u5bf9\u5e94Question\u7684QCLASS\uff0c\u6307\u5b9a\u8bf7\u6c42\u7684\u7c7b\u578b\uff0c\u5e38\u7528\u503c\u4e3a<code>IN<\/code>\uff0c\u503c\u4e3a<code>0x001<\/code>\u3002<\/p>\n<h4>TTL(Time To Live)\u8d44\u6e90\u7684\u6709\u6548\u671f<\/h4>\n<p>\u8868\u793a\u4f60\u53ef\u4ee5\u5c06\u8be5\u6761RR\u7f13\u5b58TLL\u79d2\uff0cTTL\u4e3a0\u8868\u793a\u8be5RR\u4e0d\u80fd\u88ab\u7f13\u5b58\u3002TTL\u662f\u4e00\u4e2a4\u5b57\u8282\u6709\u7b26\u53f7\u6570\uff0c\u4f46\u662f\u53ea\u4f7f\u7528\u5b83\u5927\u4e8e\u7b49\u4e8e0\u7684\u90e8\u5206\u3002<\/p>\n<h4>RDLENGTH<\/h4>\n<p>\u4e00\u4e2a\u4e24\u5b57\u8282\u975e\u8d1f\u6574\u6570\uff0c\u7528\u4e8e\u6307\u5b9aRDATA\u90e8\u5206\u7684\u957f\u5ea6\uff08\u5b57\u8282\u6570\uff09\u3002<\/p>\n<h4>RDATA<\/h4>\n<p>\u90e8\u5206\u662f\u4e00\u4e2a\u957f\u5ea6\u548c\u7ed3\u6784\u90fd\u53ef\u53d8\u7684\u5b57\u6bb5\uff0c\u5b83\u7684\u5177\u4f53\u7ed3\u6784\u53d6\u51b3\u4e8e<strong>TYPE<\/strong>\u5b57\u6bb5\u6307\u5b9a\u7684\u8d44\u6e90\u7c7b\u578b\u3002\u8be6\u7ec6\u683c\u5f0f\u4f4d\u4e8e<strong>RR Type \u8d44\u6e90\u7c7b\u578b\u3002<\/strong><\/p>\n<h2><a id=\"RRType\"><\/a>RR Type \u8d44\u6e90\u7c7b\u578b<\/h2>\n<p>\u4e3a\u4e86\u4f7fDNS\u534f\u8bae\u80fd\u591f\u5e94\u7528\u4e8e\u66f4\u591a\u7684\u573a\u666f\uff0cDNS\u534f\u8bae\u8bbe\u8ba1\u4e86\u8bb8\u591a\u79cd\u4e0d\u540c\u7684\u8d44\u6e90\u7c7b\u578b\u6765\u6ee1\u8db3\u4e0d\u540c\u573a\u666f\u7684\u9700\u6c42\u3002Type\u5b57\u6bb5\u5728DNS\u62a5\u6587\u4e2d\u957f\u5ea6\u4e3a2\u5b57\u8282\uff0c\u8fd9\u610f\u5473\u7740\u6700\u591a\u53ef\u4ee5\u670965536\u79cd\u4e0d\u540c\u7684\u8d44\u6e90\u3002<\/p>\n<p>FRC1035\u5185\u6307\u5b9a\u4e86\u7f16\u53f7\u4e3a1-16\u768416\u79cd\u8d44\u6e90\u7c7b\u578b\uff0c\u800c\u5f53\u524d\u5219\u4e00\u5171\u5b9a\u4e49\u4e86\u8fd1100\u79cd\u8d44\u6e90\u7c7b\u578b\uff0c\u8fd9\u5176\u4e2d\u5e38\u7528\u7684\u7c7b\u578b\u5e76\u4e0d\u662f\u5f88\u591a\uff0c\u5927\u7ea6\u53ea\u6709\u4ee5\u4e0b\u5341\u51e0\u79cd\u3002\u5b8c\u6574\u7684\u8d44\u6e90\u7c7b\u578b\u53ef\u4ee5\u8bbf\u95ee<a href=\"https:\/\/www.iana.org\/assignments\/dns-parameters\/dns-parameters.xhtml#dns-parameters-4\">\u6b64\u7f51\u7ad9<\/a>\u83b7\u53d6\u3002<\/p>\n<table id=\"table-dns-parameters-4\" class=\"sortable\" style=\"width: 95.9273%; height: 420px;\">\n<thead>\n<tr style=\"height: 24px;\">\n<th style=\"width: 17.8161%; height: 24px;\">\u7c7b\u578b<\/th>\n<th style=\"width: 14.0805%; height: 24px;\">\u503c<\/th>\n<th style=\"width: 39.9425%; height: 24px;\">\u542b\u4e49<\/th>\n<th style=\"width: 60.599%; height: 24px;\">Reference<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 31px;\">\n<td style=\"width: 17.8161%; height: 24px; text-align: center;\">A<\/td>\n<td style=\"width: 14.0805%; height: 24px;\" align=\"center\">1<\/td>\n<td style=\"width: 39.9425%; height: 24px;\">\u4e3b\u673a\u5730\u5740<\/td>\n<td style=\"width: 60.599%; height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 31px;\">\n<td style=\"width: 17.8161%; text-align: center; height: 24px;\">NS<\/td>\n<td style=\"width: 14.0805%; height: 24px;\" align=\"center\">2<\/td>\n<td style=\"width: 39.9425%; height: 24px;\">\u57df\u540d\u670d\u52a1\u5668\u8bb0\u5f55<\/td>\n<td style=\"width: 60.599%; height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 31px;\">\n<td style=\"width: 17.8161%; text-align: center; height: 24px;\">CNAME<\/td>\n<td style=\"width: 14.0805%; height: 24px;\" align=\"center\">5<\/td>\n<td style=\"width: 39.9425%; height: 24px;\">\u57df\u540d\u522b\u540d<\/td>\n<td style=\"width: 60.599%; height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 31px;\">\n<td style=\"width: 17.8161%; text-align: center; height: 24px;\">SOA<\/td>\n<td style=\"width: 14.0805%; height: 24px;\" align=\"center\">6<\/td>\n<td style=\"width: 39.9425%; height: 24px;\">\u6743\u5a01\u8bb0\u5f55\u8d77\u59cb<\/td>\n<td style=\"width: 60.599%; height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 31px;\">\n<td style=\"width: 17.8161%; height: 31px; text-align: center;\">PTR<\/td>\n<td style=\"width: 14.0805%; height: 31px;\" align=\"center\">12<\/td>\n<td style=\"width: 39.9425%; height: 31px;\">\u57df\u540d\u6307\u9488\uff0c\u7528\u4e8eIP\u89e3\u6790\u57df\u540d<\/td>\n<td style=\"width: 60.599%; height: 31px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 31px;\">\n<td style=\"width: 17.8161%; height: 31px; text-align: center;\">MX<\/td>\n<td style=\"width: 14.0805%; height: 31px;\" align=\"center\">15<\/td>\n<td style=\"width: 39.9425%; height: 31px;\">\u90ae\u4ef6\u4ea4\u6362<\/td>\n<td style=\"width: 60.599%; height: 31px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 31px;\">\n<td style=\"width: 17.8161%; height: 31px; text-align: center;\">TXT<\/td>\n<td style=\"width: 14.0805%; height: 31px;\" align=\"center\">16<\/td>\n<td style=\"width: 39.9425%; height: 31px;\">\u6587\u672c\u8bb0\u5f55<\/td>\n<td style=\"width: 60.599%; height: 31px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc1035\">RFC1035<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 31px;\">\n<td style=\"width: 17.8161%; height: 45px; text-align: center;\">AAAA<\/td>\n<td style=\"width: 14.0805%; height: 45px;\" align=\"center\">28<\/td>\n<td style=\"width: 39.9425%; height: 45px;\">IPV6\u4e3b\u673a\u5730\u5740<\/td>\n<td style=\"width: 60.599%; height: 45px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc3596\">RFC3596<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 31px;\">\n<td style=\"width: 17.8161%; height: 45px; text-align: center;\">SRV<\/td>\n<td style=\"width: 14.0805%; height: 45px;\" align=\"center\">33<\/td>\n<td style=\"width: 39.9425%; height: 45px;\">\u670d\u52a1\u4f4d\u7f6e\u8d44\u6e90\u8bb0\u5f55<\/td>\n<td style=\"width: 60.599%; height: 45px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc2782\">RFC2782<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 17.8161%; height: 24px; text-align: center;\">DS<\/td>\n<td style=\"width: 14.0805%; height: 24px;\" align=\"center\">43<\/td>\n<td style=\"width: 39.9425%; height: 24px;\">\u59d4\u6258\u7b7e\u53d1\u8005\uff0c\u7528\u4e8eDNSSEC<\/td>\n<td style=\"width: 60.599%; height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc4034\">RFC4034<\/a>][<a href=\"http:\/\/www.iana.org\/go\/rfc3658\">RFC3658<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 45px;\">\n<td style=\"width: 17.8161%; height: 45px; text-align: center;\">RRSIG<\/td>\n<td style=\"width: 14.0805%; height: 45px;\" align=\"center\">46<\/td>\n<td style=\"width: 39.9425%; height: 45px;\">\u7528\u4e8eDNSSEC<\/td>\n<td style=\"width: 60.599%; height: 45px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc4034\">RFC4034<\/a>][<a href=\"http:\/\/www.iana.org\/go\/rfc3755\">RFC3755<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 17.8161%; height: 24px; text-align: center;\">NSEC<\/td>\n<td style=\"width: 14.0805%; height: 24px;\" align=\"center\">47<\/td>\n<td style=\"width: 39.9425%; height: 24px;\">\u7528\u4e8eDNSSEC<\/td>\n<td style=\"width: 60.599%; height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc4034\">RFC4034<\/a>][<a href=\"http:\/\/www.iana.org\/go\/rfc3755\">RFC3755<\/a>]<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 17.8161%; height: 24px; text-align: center;\">DNSKEY<\/td>\n<td style=\"width: 14.0805%; height: 24px;\" align=\"center\">48<\/td>\n<td style=\"width: 39.9425%; height: 24px;\">\u7528\u4e8eDNSSEC<\/td>\n<td style=\"width: 60.599%; height: 24px;\">[<a href=\"http:\/\/www.iana.org\/go\/rfc4034\">RFC4034<\/a>][<a href=\"http:\/\/www.iana.org\/go\/rfc3755\">RFC3755<\/a>]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>A\u8bb0\u5f55<\/h3>\n<p>A\u5c31\u662fAddress\u7684\u9996\u5b57\u6bcd\uff0c\u5b83\u7528\u4e8e\u89e3\u6790\u4e00\u4e2a\u57df\u540d\u5bf9\u5e94\u7684IPv4\u5730\u5740\uff0c\u8fd9\u662f\u751f\u6d3b\u4e2d\u6700\u5e38\u4f7f\u7528\u7684\u8bb0\u5f55\uff0c\u6ca1\u6709\u4e4b\u4e00\u3002<\/p>\n<p>\u5b83\u957f\u5ea6\u56fa\u5b9a\u4e3a4\u5b57\u8282\uff0c\u76f4\u63a5\u4ee5\u4e8c\u8fdb\u5236\u5f62\u5f0f\u8868\u793a\u4e00\u4e2aIPv4\u5730\u5740\u3002\u4f8b\u5982IP <code>1.2.4.8<\/code>\u4f1a\u88ab\u8868\u793a\u4e3a\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n&#x5B;0x01]&#x5B;0x02]&#x5B;0x04]&#x5B;0x08]\r\n\r\n<\/pre>\n<h3>NS<\/h3>\n<p>\u57df\u540d\u670d\u52a1\u5668\u8bb0\u5f55\uff0c\u7528\u6765\u6307\u5b9a\u8be5\u57df\u540d\u7531\u54ea\u4e2aDNS\u670d\u52a1\u5668\u6765\u8fdb\u884c\u89e3\u6790\u3002\u5b83\u7684\u7ed3\u679c\u662f\u4e00\u6761\u65b0\u7684\u57df\u540d\uff0c\u4e0d\u8fc7\u662f\u6743\u5a01\u670d\u52a1\u5668\u7684\u3002<\/p>\n<p>NS\u7684\u683c\u5f0f\u548cRR\u91ccNAME\u5b57\u6bb5\u7684\u683c\u5f0f\u76f8\u540c\uff0c\u5b83\u4f7f\u7528<a href=\"#DNSStandardNameNotation\">DNS\u6807\u51c6\u540d\u79f0\u8868\u793a\u6cd5<\/a>\u8fd4\u56de\u4e00\u6761\u65b0\u57df\u540d\u3002<\/p>\n<h3>CNAME<\/h3>\n<p>CNAME\u662f\u57df\u540d\u522b\u540d\u8bb0\u5f55\uff0c\u5b83\u7528\u4e8e\u5c06\u591a\u4e2a\u57df\u540d\u6307\u5411\u540c\u4e00\u4e2a\u4e3b\u673a\u3002\u5b83\u7684\u89e3\u6790\u7ed3\u679c\u901a\u5e38\u662f\u53e6\u4e00\u4e2a\u57df\u540d\u3002CNAME\u8bb0\u5f55\u7ecf\u5e38\u5728\u8bbe\u7f6eCDN\u65f6\u88ab\u4f7f\u7528\u3002\u4f8b\u5982<strong>example.com<\/strong>\u4f7f\u7528\u4e86<strong>cdn.example.net<\/strong>\u516c\u53f8\u7684CDN\u670d\u52a1\uff08\u5047\u8bbeIP=<strong>1.1.1.1<\/strong>\uff09\u3002\u4f60\u5f53\u7136\u53ef\u4ee5\u76f4\u63a5\u5c06example.com\u76f4\u63a5\u4f7f\u7528A\u8bb0\u5f55\u89e3\u6790\u52301.1.1.1\uff0c\u4f46\u662f\u7531\u4e8eCDN\u4e0d\u662f\u7531\u4f60\u76f4\u63a5\u7ba1\u7406\u7684\uff0c\u8fd9\u4e2aip\u5730\u5740\u53ef\u80fd\u4f1a\u53d1\u751f\u53d8\u5316\u3002\u5982\u679c\u8be5\u516c\u53f8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u57df\u540dcdn.example.net\uff0c\u5e76\u4e14\u5bf9\u8be5\u57df\u540d\u8bbe\u7f6e\u4e86\u89e3\u6790\uff0c\u4f60\u5c31\u53ea\u9700\u8981\u5c06\u4f60\u7684\u57df\u540dexample.com\u901a\u8fc7CNAME\u89e3\u6790\u5230cdn.example.net\uff0c\u544a\u8bc9\u89e3\u6790\u8005\uff0cexample.com\u662fcdn.example.net\u7684\u522b\u540d\uff0cIP\u4ece\u4ed6\u90a3\u513f\u83b7\u53d6\u5373\u53ef\u3002<\/p>\n<p>CNAME\u7684\u683c\u5f0f\u548c\u4e0a\u9762NS\u8bb0\u5f55\u683c\u5f0f\u76f8\u540c\uff0c\u5b83\u4f7f\u7528<a href=\"#DNSStandardNameNotation\">DNS\u6807\u51c6\u540d\u79f0\u8868\u793a\u6cd5<\/a>\u8fd4\u56de\u4e00\u6761\u65b0\u57df\u540d\u3002<\/p>\n<h3>SOA<\/h3>\n<p>SOA\u57fa\u672c\u4e0a\u662f\u6700\u590d\u6742\u7684\u8d44\u6e90\u8bb0\u5f55\u7c7b\u578b\u4e86\uff0c\u6ca1\u6709\u4e4b\u4e00\uff0c\u5b83\u7684\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    \/                     MNAME                     \/\r\n    \/                                               \/\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    \/                     RNAME                     \/\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                    SERIAL                     |\r\n    |                                               |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                    REFRESH                    |\r\n    |                                               |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                     RETRY                     |\r\n    |                                               |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                    EXPIRE                     |\r\n    |                                               |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                    MINIMUM                    |\r\n    |                                               |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n<\/pre>\n<p>SOA\u5373Start Of Zone\uff0c\u201c\u533a\u57df\u5f00\u59cb\u8bb0\u5f55\u201d\uff0c\u8fd9\u4e2a\u8bb0\u5f55\u4e3b\u8981\u7528\u4e8e\u6743\u5a01DNS\u670d\u52a1\u5668\u8fdb\u884c\u4e3b\u4ece\u540c\u6b65\u3002<\/p>\n<ul>\n<li><strong>MNAME<\/strong> \u8be5\u533a\u57df\u7684\u4e3b\u540d\u79f0\u670d\u52a1\u5668<\/li>\n<li><strong>RNAME<\/strong> \u8d1f\u8d23\u6b64\u533a\u57df\u7684\u7ba1\u7406\u5458\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u3002<\/li>\n<li><strong>SERIAL<\/strong> \u533a\u57df\u5e8f\u5217\u53f7\uff0c32bit\u65e0\u7b26\u53f7\u6574\u578b\uff0c\u4ece\u670d\u52a1\u5668\u53d1\u73b0\u8fd9\u4e2a\u503c\u66f4\u65b0\u7684\u65f6\u5019\u4f1a\u542f\u52a8\u4e00\u6b21\u540c\u6b65\u3002<\/li>\n<li><strong>REFRESH<\/strong> \u4ece\u670d\u52a1\u5668\u4ece\u4e3b\u670d\u52a1\u5668\u4e0a\u83b7\u53d6SOA\u8bb0\u5f55\u7684\u5468\u671f<\/li>\n<li><strong>RETRY<\/strong> \u91cd\u8bd5\u65f6\u95f4\uff0c\u5f53\u4ece\u670d\u52a1\u5668\u83b7\u53d6SOA\u5931\u8d25\u65f6\u4f1a\u5728\u8be5\u5b57\u6bb5\u6307\u5b9a\u7684\u65f6\u95f4\u5185\u91cd\u65b0\u5c1d\u8bd5\u83b7\u53d6\uff0c\u8fd9\u4e2a\u503c\u5e94\u5f53\u5c0f\u4e8eREFRESH<\/li>\n<li><strong>EXPIRE<\/strong> \u8fc7\u671f\u65f6\u95f4\uff0c\u5982\u679c\u4ece\u4e3b\u670d\u52a1\u5668\u4e00\u76f4\u672a\u54cd\u5e94\uff0c\u5219\u5728\u8be5\u65f6\u95f4\u540e\u4e0d\u518d\u54cd\u5e94\u8be5\u533a\u57df\u7684\u8bf7\u6c42\u3002\u8fd9\u4e2a\u503c\u5e94\u8be5\u5927\u4e8eREFRESH+RETRY\u3002<\/li>\n<li><strong>MINIMUM<\/strong> \u8be5\u533a\u57df\u5185\u6240\u6709\u8bb0\u5f55TTL\u7684\u4e0b\u9650\u3002<\/li>\n<\/ul>\n<p>\u6240\u6709\u7684\u65f6\u95f4\u5355\u4f4d\u90fd\u662f\u79d2\uff0c\u9664\u524d\u4e24\u4e2a\u5b57\u6bb5\u4f7f\u7528<a href=\"#DNSStandardNameNotation\">DNS\u6807\u51c6\u540d\u79f0\u8868\u793a\u6cd5<\/a>\u4ee5\u5916\uff0c\u5176\u5b83\u5b57\u6bb5\u957f\u5ea6\u90fd\u662f32bit\u3002SOA\u8bb0\u5f55\u7684TTL\u90fd\u662f0\uff0c\u4e5f\u5c31\u662f\u8bf4\u8fd9\u4e2a\u8bb0\u5f55\u4e0d\u80fd\u88ab\u7f13\u5b58\u3002<\/p>\n<h3>PTR<\/h3>\n<p>ptr\u7528\u4e8e\u5c06ip\u5730\u5740\u53cd\u5411\u89e3\u6790\u51fa\u57df\u540d\u3002\u5b83\u548c.arpa\u57df\u540d\u8054\u5408\u4f7f\u7528\u3002\u4f8b\u5982\u5bf9114.114.114.114\u505a\u53cd\u5411\u89e3\u6790\u53ef\u4ee5\u83b7\u5f97\u7ed3\u679c\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n;; ANSWER SECTION:\r\n114.114.114.114.in-addr.arpa. 556 IN PTR public1.114dns.com.\r\n\r\n<\/pre>\n<h4>MX<\/h4>\n<p>\u90ae\u4ef6\u4ea4\u6362\u8bb0\u5f55\uff0c\u7528\u4e8e\u8bbe\u7f6e\u7535\u5b50\u90ae\u4ef6\u53d1\u9001\u5730\u5740\u3002\u901a\u5e38\u4f1a\u8bbe\u7f6e\u591a\u6761\u4e0d\u540c\u4f18\u5148\u7ea7\u7684MX\u8bb0\u5f55\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                  PREFERENCE                   |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    \/                   EXCHANGE                    \/\r\n    \/                                               \/\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n\r\n<\/pre>\n<ul>\n<li><strong>PREFERENCE<\/strong> \u662f\u4e00\u4e2a16bit\u6570\uff0c\u5b83\u8868\u793a\u8be5\u6761\u8bb0\u5f55\u7684\u4f18\u5148\u7ea7\uff0c\u503c\u8d8a\u5c0f\u4f18\u5148\u7ea7\u8d8a\u9ad8\u3002<\/li>\n<li><strong>EXCHANGE <\/strong>\u4e00\u4e2a\u57df\u540d\uff0c\u683c\u5f0f\u4e3a<a href=\"#DNSStandardNameNotation\">DNS\u6807\u51c6\u540d\u79f0\u8868\u793a\u6cd5<\/a>\u3002<\/li>\n<\/ul>\n<h4>TXT<\/h4>\n<p>\u76f4\u63a5\u5c31\u662f\u4e00\u6bb5\u6587\u672c\uff0c\u901a\u5e38\u4f1a\u7528\u4f5c\u57df\u540d\u9a8c\u8bc1\u7528\u9014\u3002\u4f8b\u5982TXT\u8bb0\u5f55\u201cabcdefg\u201d\u683c\u5f0f\u4e3a\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n&#x5B;'a']&#x5B;'b']&#x5B;'c']&#x5B;'d']&#x5B;'e']&#x5B;'f']&#x5B;'g']\r\n\r\n<\/pre>\n<h4>AAAA<\/h4>\n<p>AAAA\u4e00\u770b\u5c31\u548cA\u6709\u5173\u7cfb\uff0c\u5b83\u88ab\u7528\u4e8eIPv6\u5730\u5740\u7684\u89e3\u6790\u3002AAAA\u662f4\u4e2aA\uff0c\u800c\u4e00\u4e2aIPv6\u5730\u5740\u7684\u4e8c\u8fdb\u5236\u957f\u5ea6\u4e5f\u6b63\u597d\u662fIPv4\u5730\u5740\u76844\u500d\uff08IPv6 16Byte\uff0cIPv4 4Byte\uff09\u3002 \u5b83\u7684\u683c\u5f0f\u548cA\u8bb0\u5f55\u4e00\u6a21\u4e00\u6837\uff0c\u53ea\u4e0d\u8fc7\u957f\u5ea6\u6269\u5c55\u4e86\u56db\u500d\u3002\u56e0\u6b64\u8fd9\u4e2a\u8bb0\u5f55\u7684RDATA\u957f\u5ea6\u662f\u56fa\u5b9a\u768416\u5b57\u8282\u3002\u5730\u5740FE80::1\u7684AAAA RDATA\u90e8\u5206\u683c\u5f0f\u4e3a\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n&#x5B;0xFE]&#x5B;0x80]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x00]&#x5B;0x01]\r\n\r\n<\/pre>\n<p>\u5b9e\u9645\u4e0a\u5728\u65e9\u671f\u8fd8\u6709\u4e00\u4e2a\u53ebA6\u7684IPv6\u5730\u5740\u8d44\u6e90\u7c7b\u578b\uff0c\u4e0d\u540c\u70b9\u662fA6\u662f\u53d8\u957f\u7684\uff0c\u4f46\u662fA6\u5df2\u7ecf\u88ab\u5e9f\u5f03\u4e0d\u518d\u4f7f\u7528\uff0cIPv6\u5730\u5740\u5168\u90e8\u4f7f\u7528AAAA\u8bb0\u5f55\u8fdb\u884c\u89e3\u6790\u3002<\/p>\n<h4>SRV<\/h4>\n<p>SRV\u8bb0\u5f55\u4e5f\u5f88\u5c11\u4f7f\u7528\uff0c\u5b83\u7528\u6765\u6807\u8bc6\u67d0\u53f0\u670d\u52a1\u5668\u4f7f\u7528\u4e86\u67d0\u4e2a\u670d\u52a1\u3002\u5b83\u7684\u683c\u5f0f\u4e3a\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                   PRIORITY                    |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                    WEIGHT                     |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    |                     PORT                      |\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n    \/                    TARGET                     \/\r\n    \/                                               \/\r\n    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n\r\n<\/pre>\n<p>PRIORITY\u3001WEIGHT\u3001\u548cPORT\u90fd\u662f16\u4f4d\u7684\u65e0\u7b26\u53f7\u6574\u578b\u3002TARGET\u5219\u662f\u4e00\u4e2a\u57df\u540d\uff0c\u5b83\u4f7f\u7528<a href=\"#DNSStandardNameNotation\">DNS\u6807\u51c6\u540d\u79f0\u8868\u793a\u6cd5<\/a>\uff0c\u4f46\u5728\u8be5\u5b57\u6bb5\u4e0a\u4e0d\u4f7f\u7528\u538b\u7f29\u3002<\/p>\n<p><strong>DS<\/strong>\u3001<strong>RRSIG<\/strong>\u3001<strong>NSEC<\/strong>\u548c<strong>DNSKEY<\/strong>\u56db\u4e2a\u7c7b\u578b\u7528\u4e8eDNSSEC\uff0c\u5177\u4f53\u683c\u5f0f\u548c\u4ecb\u7ecd\u653e\u5728\u4e0b\u4e00\u7bc7\u6587\u7ae0\u5185\u3002<\/p>\n<h2>\u62a5\u6587\u4f20\u8f93<\/h2>\n<p>DNS\u5de5\u4f5c\u5728UDP\u548cTCP\u4e0a\uff0c\u90fd\u4f7f\u752853\u7aef\u53e3\u3002<\/p>\n<p>\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0cDNS\u8bf7\u6c42\u548c\u54cd\u5e94\u90fd\u4f7f\u7528UDP\u6570\u636e\u5305\uff0c\u6b64\u65f6UDP\u7684payload\u4fbf\u76f4\u63a5\u662fDNS\u7684\u62a5\u6587\u3002<\/p>\n<p>\u5f53\u4f7f\u7528TCP\u65f6\uff0c\u6574\u4e2aDNS\u62a5\u6587\u90e8\u5206\u6ca1\u6709\u4efb\u4f55\u53d8\u5316\uff0c\u4f46\u662f\u7531\u4e8eTCP\u662f\u4e00\u4e2a\u6d41\u534f\u8bae\uff0c\u4f60\u9700\u8981\u989d\u5916\u6307\u5b9a\u4e00\u4e2a\u62a5\u6587\u957f\u5ea6\u6765\u8fdb\u884c\u62a5\u6587\u5212\u5206\u3002\u8fd9\u4e2a\u957f\u5ea6\u5b57\u6bb5\u957f2\u5b57\u8282\uff0c\u5728DNS\u62a5\u6587\u4e4b\u524d\u53d1\u9001\u3002\u56e0\u6b64\u5bf9\u4e8e\u62a5\u6587\u201dMessage\u201c\uff0c\u4f7f\u7528TCP\u65f6\uff0c\u5b9e\u9645\u4f20\u8f93\u7684\u6570\u636e\u662f\uff1a<\/p>\n<p><code>[2\u5b57\u8282Message\u62a5\u6587\u957f\u5ea6][Message\u5177\u4f53\u5185\u5bb9]<\/code><\/p>\n<p>\u540c\u6837\u7684\uff0c\u8fd9\u4e2a\u957f\u5ea6\u5b57\u6bb5\u4f7f\u7528\u7f51\u7edc\u5e8f\u3002<\/p>\n<p>\u7531\u4e8eUDP\u53ea\u63d0\u4f9b\u5c3d\u529b\u800c\u4e3a\u7684\u670d\u52a1\uff0c\u8bf7\u6c42\u62a5\u6587\u548c\u54cd\u5e94\u62a5\u6587\u90fd\u53ef\u80fd\u5728\u94fe\u8def\u4e0a\u4e22\u5931\u3002\u56e0\u6b64\u4e3a\u4e86\u4fdd\u8bc1\u67e5\u8be2\u7684\u53ef\u9760\u6027\uff0c<strong>\u4f7f\u7528UDP\u8fdb\u884cDNS\u67e5\u8be2\u65f6\u5fc5\u987b\u8bbe\u8ba1\u91cd\u4f20\u673a\u5236<\/strong>\u3002RFC1035\u5efa\u8bae\uff0c\u8d85\u65f6\u91cd\u4f20\u7684\u65f6\u95f4\u5e94\u8be5\u5c3d\u53ef\u80fd\u7684\u901a\u8fc7\u5206\u6790\u7edf\u8ba1\u5f97\u51fa\uff0c\u5efa\u8bae\u91cd\u4f20\u65f6\u95f4\u4e3a2-5\u79d2\u3002<\/p>\n<h3>\u53c2\u8003\u8d44\u6599<\/h3>\n<p><a href=\"https:\/\/tools.ietf.org\/html\/rfc1035\">https:\/\/tools.ietf.org\/html\/rfc1035<\/a><\/p>\n<p><a href=\"https:\/\/tools.ietf.org\/html\/rfc1034\">https:\/\/tools.ietf.org\/html\/rfc1034<\/a><\/p>\n<p><a href=\"http:\/\/www.tcpipguide.com\/free\/t_TCPIPDomainNameSystemDNS.htm\">http:\/\/www.tcpipguide.com\/free\/t_TCPIPDomainNameSystemDNS.htm<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u7bc7\u6587\u7ae0\u662f\u7528Golang\u5b9e\u73b0\u4e00\u4e2aDNS\u670d\u52a1\u5668\u7cfb\u5217\u7b2c\u4e8c\u90e8\u5206\u7684\u4e2d\u7bc7\u3002 \u8fd9\u4e00\u7bc7\u6587\u7ae0\u5c06\u4f1a\u8be6\u7ec6\u7684\u5206\u6790RFC1035\u6587\u6863\u4e2d\u2026 <span class=\"read-more\"><a href=\"https:\/\/yangwang.hk\/?p=878\">Read More: DNS\u534f\u8bae\u8be6\u89e3 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-878","post","type-post","status-publish","format-standard","hentry","category-9"],"views":4866,"_links":{"self":[{"href":"https:\/\/yangwang.hk\/index.php?rest_route=\/wp\/v2\/posts\/878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yangwang.hk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yangwang.hk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yangwang.hk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yangwang.hk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=878"}],"version-history":[{"count":35,"href":"https:\/\/yangwang.hk\/index.php?rest_route=\/wp\/v2\/posts\/878\/revisions"}],"predecessor-version":[{"id":917,"href":"https:\/\/yangwang.hk\/index.php?rest_route=\/wp\/v2\/posts\/878\/revisions\/917"}],"wp:attachment":[{"href":"https:\/\/yangwang.hk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yangwang.hk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yangwang.hk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}