{"id":8343,"date":"2022-01-26T11:09:48","date_gmt":"2022-01-26T03:09:48","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=8343"},"modified":"2024-02-24T21:20:24","modified_gmt":"2024-02-24T13:20:24","slug":"%e5%9c%a8opnsense%e4%b8%ad%e9%87%8d%e5%ae%9a%e5%90%91dns%e8%af%b7%e6%b1%82%e5%88%b0%e6%9c%ac%e5%9c%b0dns%e8%a7%a3%e6%9e%90%e5%99%a8","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=8343","title":{"rendered":"OPNsense\u91cd\u5b9a\u5411DNS\u8bf7\u6c42\u5230\u672c\u5730DNS\u89e3\u6790\u5668"},"content":{"rendered":"<p style=\"text-align: justify;\">\u5982\u679c\u4e0d\u60f3\u8ba9\u9632\u706b\u5899\u540e\u9762\u7684\u5ba2\u6237\u7aef\u4f7f\u7528\u81ea\u5b9a\u4e49\u6216\u5176\u4ed6\u516c\u5171DNS\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u89c4\u5219\uff0c\u5c06\u6240\u6709\u5bf9\u5916\u90e8\u670d\u52a1\u5668\u7684DNS\u8bf7\u6c42\u91cd\u5b9a\u5411\u5230\u672c\u5730DNS\u670d\u52a1\u5668\u3002\u8fd9\u4e0d\u4f46\u6709\u52a9\u4e8e\u786e\u4fdd\u7f51\u7edc\u8bbe\u5907\u7684\u6b63\u5e38\u529f\u80fd\uff0c\u800c\u4e14\u8fd8\u53ef\u4ee5\u5e94\u7528DNS\u7684\u963b\u6b62\/\u8fc7\u6ee4\u529f\u80fd\u3002<\/p>\n<h1 id=\"creating-a-nat-port-forward-rule-for-dns-redirection\" style=\"text-align: justify;\">\u521b\u5efa\u7aef\u53e3\u8f6c\u53d1\u89c4\u5219<\/h1>\n<p style=\"text-align: justify;\">\u8fdb\u5165\u201c\u9632\u706b\u5899 &gt; NAT &gt; \u7aef\u53e3\u8f6c\u53d1\u201d\u9875\u9762\uff0c\u7136\u540e\u5355\u51fb\u201c\u6dfb\u52a0\u201d\u6309\u94ae\u3002\u8fdb\u884c\u4ee5\u4e0b\u8bbe\u7f6e\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u9009\u9879<\/th>\n<th>\u503c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u63a5\u53e3<\/td>\n<td>IOT<\/td>\n<\/tr>\n<tr>\n<td>\u534f\u8bae<\/td>\n<td>TCP\/UDP<\/td>\n<\/tr>\n<tr>\n<td>\u76ee\u6807\/\u53cd\u8f6c<\/td>\n<td>\u9009\u4e2d<\/td>\n<\/tr>\n<tr>\n<td>\u76ee\u6807<\/td>\n<td>IOT net<\/td>\n<\/tr>\n<tr>\n<td>\u76ee\u6807\u7aef\u53e3\u8303\u56f4<\/td>\n<td>DNS<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u5b9a\u5411\u76ee\u6807IP<\/td>\n<td>127.0.0.1<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u5b9a\u5411\u76ee\u6807\u7aef\u53e3<\/td>\n<td>DNS<\/td>\n<\/tr>\n<tr>\n<td>\u63cf\u8ff0<\/td>\n<td>Redirect DNS requests to internal DNS resolver<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/nat-port-forward-dns-redirect-rule_hu38215755fc754232408d01bf787f1fb1_48296_1080x0_resize_q75_h2_box_3.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9485\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/nat-port-forward-dns-redirect-rule_hu38215755fc754232408d01bf787f1fb1_48296_1080x0_resize_q75_h2_box_3.webp\" alt=\"\" width=\"1080\" height=\"871\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/nat-port-forward-dns-redirect-rule_hu38215755fc754232408d01bf787f1fb1_48296_1080x0_resize_q75_h2_box_3.webp 1080w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/nat-port-forward-dns-redirect-rule_hu38215755fc754232408d01bf787f1fb1_48296_1080x0_resize_q75_h2_box_3-300x242.webp 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/nat-port-forward-dns-redirect-rule_hu38215755fc754232408d01bf787f1fb1_48296_1080x0_resize_q75_h2_box_3-1024x826.webp 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/nat-port-forward-dns-redirect-rule_hu38215755fc754232408d01bf787f1fb1_48296_1080x0_resize_q75_h2_box_3-768x619.webp 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/nat-port-forward-dns-redirect-rule_hu38215755fc754232408d01bf787f1fb1_48296_1080x0_resize_q75_h2_box_3-372x300.webp 372w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u201c\u63a5\u53e3\u201d\u662f\u4f60\u60f3\u5b9a\u4e49\u7684\u672c\u5730\u7f51\u7edc\u63a5\u53e3\u3002\u201c\u76ee\u6807\u201d\u662f\u4e3a\u63a5\u53e3\u9009\u62e9\u7cfb\u7edf\u751f\u6210\u7684\u7f51\u7edc\u5730\u5740\u3002\u9009\u62e9\u201cDNS\u201d\u4f5c\u4e3a\u201c\u76ee\u6807\u7aef\u53e3\u8303\u56f4\u201d\uff0c\u56e0\u4e3a\u8fd9\u662f\u8981\u5339\u914dDNS\u8bf7\u6c42\u7684\u6d41\u91cf\u3002\u201c\u91cd\u5b9a\u5411\u76ee\u6807 IP\u201d\u8bbe\u7f6e\u4e3a127.0.0.1 (localhost)\uff0c\u662f\u8981\u4f7f\u7528OPNsense\u4e2d\u7684\u5185\u90e8Unbound DNS\u670d\u52a1\u3002<\/p>\n<p style=\"text-align: justify;\">\u8fd9\u91cc\u7684\u9009\u4e2d\u201cDestination\/Invert(\u76ee\u6807\/\u53cd\u8f6c)\u201d\u975e\u5e38\u91cd\u8981\uff0c\u56e0\u4e3a<em>\u8fd9<\/em>\u4f1a\u4f7f\u89c4\u5219\u5339\u914d\u6765\u81ea IOT \u7f51\u7edc\u7684\u4efb\u4f55\u6d41\u91cf\uff0c\u800c\u4e0d\u662f\u4f7f\u7528\u672c\u5730IOT\u63a5\u53e3\/\u7f51\u5173IP\u5730\u5740\u6765\u89e3\u6790DNS\u67e5\u8be2\u3002\u8fd9\u6761\u89c4\u5219\u5c06\u6240\u6709\u63a5\u53e3\u5730\u5740\u7684DNS\u67e5\u8be2\u90fd\u91cd\u5b9a\u5411\u5230\u672c\u5730Unbound DNS\u89e3\u6790\u5668\uff0c\u5373127.0.0.1\u7684localhost \u5730\u5740\u3002<\/p>\n<p style=\"text-align: justify;\">\u5355\u51fb\u201c\u4fdd\u5b58\u201d\u6309\u94ae\u5e76\u5e94\u7528\u66f4\u6539\u540e\uff0c\u8f6c\u5230\u201c\u9632\u706b\u5899 &gt; \u89c4\u5219&gt; IOT\u201d\u9875\u9762\u3002\u5c06DNS\u91cd\u5b9a\u5411\u89c4\u5219\u79fb\u52a8\u5230\u5217\u8868\u9876\u90e8\uff0c\u786e\u4fdd\u5b83\u6709\u66f4\u9ad8\u7684\u4f18\u5148\u7ea7\u3002<\/p>\n<p>\u5982\u679c\u9632\u706b\u5899\u6709\u591a\u4e2a\u5185\u90e8\u63a5\u53e3\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u201c<a href=\"https:\/\/blog.pfchina.org\/?p=7854\">\u7ec4<\/a>\u201d\u6765\u521b\u5efa\u4e00\u7cfb\u5217\u7684\u89c4\u5219\u3002<\/p>\n<h1 id=\"multiple-interface-configuration\" style=\"text-align: justify;\">\u591a\u63a5\u53e3\u914d\u7f6e<\/h1>\n<p style=\"text-align: justify;\">\u4e3a\u4e86\u5c06\u5355\u4e2a\u89c4\u5219\u5e94\u7528\u4e8e\u591a\u4e2a\u63a5\u53e3\uff0c\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u9632\u706b\u5899\u7ec4\u3002\u9632\u706b\u5899\u7ec4\u5141\u8bb8\u5bf9\u591a\u4e2a\u63a5\u53e3\u8fdb\u884c\u5206\u7ec4\u5e76\u521b\u5efa\u9002\u7528\u4e8e\u7ec4\u4e2d\u6240\u6709\u63a5\u53e3\u7684\u89c4\u5219\u3002\u7ec4\u4e2d\u7684\u89c4\u5219\u5904\u7406\u987a\u5e8f\u4f18\u5148\u4e8e\u63a5\u53e3\u89c4\u5219\u3002<\/p>\n<p style=\"text-align: justify;\">\u8981\u521b\u5efa\u89c4\u5219\u7ec4\uff0c\u8bf7\u8f6c\u5230\u201c\u9632\u706b\u5899 &gt; \u7ec4\u201d\u9875\u9762\u3002\u7136\u540e\u5355\u51fb\u201c\u6dfb\u52a0\u201d\u6309\u94ae\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/firewall-groups_hu0d95ca9a70c14adad77245a308ad5daa_30190_1362x0_resize_q75_h2_box_3.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9486\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/firewall-groups_hu0d95ca9a70c14adad77245a308ad5daa_30190_1362x0_resize_q75_h2_box_3.webp\" alt=\"\" width=\"1362\" height=\"334\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/firewall-groups_hu0d95ca9a70c14adad77245a308ad5daa_30190_1362x0_resize_q75_h2_box_3.webp 1362w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/firewall-groups_hu0d95ca9a70c14adad77245a308ad5daa_30190_1362x0_resize_q75_h2_box_3-300x74.webp 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/firewall-groups_hu0d95ca9a70c14adad77245a308ad5daa_30190_1362x0_resize_q75_h2_box_3-1024x251.webp 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/firewall-groups_hu0d95ca9a70c14adad77245a308ad5daa_30190_1362x0_resize_q75_h2_box_3-768x188.webp 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/firewall-groups_hu0d95ca9a70c14adad77245a308ad5daa_30190_1362x0_resize_q75_h2_box_3-500x123.webp 500w\" sizes=\"auto, (max-width: 1362px) 100vw, 1362px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u8f93\u5165\u9632\u706b\u5899\u7ec4\u7684\u201c\u540d\u79f0\u201d\uff0c\u672c\u4f8b\u4e2d\u4e3aCommonDNS\uff0c\u7136\u540e\u9009\u4e2d\u91cd\u5b9a\u5411DNS\u8bf7\u6c42\u7684\u6240\u6709\u63a5\u53e3\u3002\u5355\u51fb\u201c\u4fdd\u5b58\u201d\u6765\u521b\u5efa\u7ec4\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/create-firewall-group_hu57680c7c4cfa85d50c5e06bb7bfac8e6_36742_915x0_resize_q75_h2_box_3.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9487\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/create-firewall-group_hu57680c7c4cfa85d50c5e06bb7bfac8e6_36742_915x0_resize_q75_h2_box_3.webp\" alt=\"\" width=\"915\" height=\"525\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/create-firewall-group_hu57680c7c4cfa85d50c5e06bb7bfac8e6_36742_915x0_resize_q75_h2_box_3.webp 915w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/create-firewall-group_hu57680c7c4cfa85d50c5e06bb7bfac8e6_36742_915x0_resize_q75_h2_box_3-300x172.webp 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/create-firewall-group_hu57680c7c4cfa85d50c5e06bb7bfac8e6_36742_915x0_resize_q75_h2_box_3-768x441.webp 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/create-firewall-group_hu57680c7c4cfa85d50c5e06bb7bfac8e6_36742_915x0_resize_q75_h2_box_3-500x287.webp 500w\" sizes=\"auto, (max-width: 915px) 100vw, 915px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u7136\u540e\uff0c\u50cf\u524d\u9762\u4e00\u6837\u521b\u5efa\u91cd\u5b9a\u5411\u89c4\u5219\uff0c\u9664\u4e86\u63a5\u53e3\u548c\u76ee\u6807\u662f\u7ec4\u4ee5\u5916\uff0c\u5176\u4ed6\u9009\u9879\u90fd\u76f8\u540c\u3002\u8f6c\u5230\u201c\u9632\u706b\u5899 &gt; NAT &gt; \u7aef\u53e3\u8f6c\u53d1\u201d\u9875\u9762\u4e0a\uff0c\u5355\u51fb\u201c\u6dfb\u52a0\u201d\u6309\u94ae\u3002\u8f93\u5165\u4ee5\u4e0b\u503c\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u9009\u9879<\/th>\n<th>\u503c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u63a5\u53e3<\/td>\n<td>CommonDNS<\/td>\n<\/tr>\n<tr>\n<td>\u534f\u8bae<\/td>\n<td>TCP\/UDP<\/td>\n<\/tr>\n<tr>\n<td>\u76ee\u6807\/\u53cd\u8f6c<\/td>\n<td>\u9009\u4e2d<\/td>\n<\/tr>\n<tr>\n<td>\u76ee\u6807<\/td>\n<td>CommonDNS<\/td>\n<\/tr>\n<tr>\n<td>\u76ee\u6807\u7aef\u53e3\u8303\u56f4<\/td>\n<td>DNS<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u5b9a\u5411\u76ee\u6807IP<\/td>\n<td>127.0.0.1<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u5b9a\u5411\u76ee\u6807\u7aef\u53e3<\/td>\n<td>DNS<\/td>\n<\/tr>\n<tr>\n<td>\u63cf\u8ff0<\/td>\n<td>Redirect DNS requests to internal DNS resolver<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: justify;\">\u8f6c\u5230\u201c\u9632\u706b\u5899 &gt; \u89c4\u5219 &gt; CommonDNS\u201d\u9875\u9762\u4e0a\u67e5\u770bNAT \u7aef\u53e3\u8f6c\u53d1\u7684\u91cd\u5b9a\u5411\u89c4\u5219\u662f\u5426\u5df2\u81ea\u52a8\u6dfb\u52a0\u5230\u89c4\u5219\u5217\u8868\u4e2d\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/common-dns-rules_huf1db2a29d4bc96d8cfeee48924b5d0db_44527_1520x0_resize_q75_h2_box_3.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9488\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/common-dns-rules_huf1db2a29d4bc96d8cfeee48924b5d0db_44527_1520x0_resize_q75_h2_box_3.webp\" alt=\"\" width=\"1520\" height=\"366\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/common-dns-rules_huf1db2a29d4bc96d8cfeee48924b5d0db_44527_1520x0_resize_q75_h2_box_3.webp 1520w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/common-dns-rules_huf1db2a29d4bc96d8cfeee48924b5d0db_44527_1520x0_resize_q75_h2_box_3-300x72.webp 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/common-dns-rules_huf1db2a29d4bc96d8cfeee48924b5d0db_44527_1520x0_resize_q75_h2_box_3-1024x247.webp 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/common-dns-rules_huf1db2a29d4bc96d8cfeee48924b5d0db_44527_1520x0_resize_q75_h2_box_3-768x185.webp 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/common-dns-rules_huf1db2a29d4bc96d8cfeee48924b5d0db_44527_1520x0_resize_q75_h2_box_3-500x120.webp 500w\" sizes=\"auto, (max-width: 1520px) 100vw, 1520px\" \/><\/a><\/p>\n<h1 id=\"testing-the-redirection\" style=\"text-align: justify;\">\u6d4b\u8bd5\u91cd\u5b9a\u5411<\/h1>\n<p style=\"text-align: justify;\">\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0DNS\u8986\u76d6\u7684\u65b9\u6cd5\u6765\u8fdb\u884c\u6d4b\u8bd5\u3002DNS \u8986\u76d6\u53ef\u7528\u4e8e\u4e3a\u7ed9\u5b9a\u57df\u8bbe\u7f6e\u4e0d\u540c\u7684IP\u5730\u5740\uff0c\u5305\u62ec Internet \u4e0a\u7684\u516c\u5171\u57df\u540d\u3002<\/p>\n<p style=\"text-align: justify;\">\u8f6c\u5230\u201c\u670d\u52a1 &gt; Unbound DNS &gt; \u8986\u76d6\u201d\u9875\u9762\u3002\u5355\u51fb\u201c \u201d\u6309\u94ae\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u8986\u76d6\u3002\u8f93\u5165\u4e00\u4e2a\u4e0d\u7528\u4e8e\u7f51\u7edc\u4e0a\u4efb\u4f55\u5185\u5bb9\u7684\u77e5\u540d\u57df\u540d\uff0c\u4f8b\u5982yahoo.com\uff0c\u9009\u62e9\u4e00\u4e2a\u968f\u673a\u7684\u672c\u5730 IP \u5730\u5740\uff0c\u4f8b\u5982 192.168.20.200\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-1_hue22c1336dd1f18de141916f0c5d8cdf4_46317_871x0_resize_q75_h2_box_3.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9489\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-1_hue22c1336dd1f18de141916f0c5d8cdf4_46317_871x0_resize_q75_h2_box_3.webp\" alt=\"\" width=\"871\" height=\"642\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-1_hue22c1336dd1f18de141916f0c5d8cdf4_46317_871x0_resize_q75_h2_box_3.webp 871w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-1_hue22c1336dd1f18de141916f0c5d8cdf4_46317_871x0_resize_q75_h2_box_3-300x221.webp 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-1_hue22c1336dd1f18de141916f0c5d8cdf4_46317_871x0_resize_q75_h2_box_3-768x566.webp 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-1_hue22c1336dd1f18de141916f0c5d8cdf4_46317_871x0_resize_q75_h2_box_3-407x300.webp 407w\" sizes=\"auto, (max-width: 871px) 100vw, 871px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u4fdd\u5b58\u8986\u76d6\u540e\uff0c\u5355\u51fb\u201c\u5e94\u7528\u201d\u6309\u94ae\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-2_hu611f03433a5af619c54d30c0aa1874d9_19315_1287x0_resize_q75_h2_box_3.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9490\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-2_hu611f03433a5af619c54d30c0aa1874d9_19315_1287x0_resize_q75_h2_box_3.webp\" alt=\"\" width=\"1287\" height=\"260\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-2_hu611f03433a5af619c54d30c0aa1874d9_19315_1287x0_resize_q75_h2_box_3.webp 1287w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-2_hu611f03433a5af619c54d30c0aa1874d9_19315_1287x0_resize_q75_h2_box_3-300x61.webp 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-2_hu611f03433a5af619c54d30c0aa1874d9_19315_1287x0_resize_q75_h2_box_3-1024x207.webp 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-2_hu611f03433a5af619c54d30c0aa1874d9_19315_1287x0_resize_q75_h2_box_3-768x155.webp 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2022\/01\/dns-override-2_hu611f03433a5af619c54d30c0aa1874d9_19315_1287x0_resize_q75_h2_box_3-500x101.webp 500w\" sizes=\"auto, (max-width: 1287px) 100vw, 1287px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u5982\u679c\u4f7f\u7528\u7684\u662fLinux\uff0c\u5219\u53ef\u4ee5\u8fd0\u884c<code>host<\/code>\u547d\u4ee4\u6765\u8fdb\u884c DNS \u67e5\u627e\u4ee5\u67e5\u770b\u8fd4\u56de\u7684 IP \u5730\u5740\u3002\u5982\u4e0b\u6240\u793a\uff0c\u8fd4\u56de\u7684\u662f\u672c\u5730IP\u5730\u5740\u800c\u4e0d\u662f\u516c\u5171IP\u5730\u5740\uff1a<\/p>\n<div class=\"highlight\" style=\"text-align: justify;\">\n<pre tabindex=\"0\"><code class=\"language-text\" data-lang=\"text\">$ host <a class=\"vglnk\" href=\"http:\/\/yahoo.com\/\" rel=\"nofollow\">yahoo.com<\/a> 8.8.8.8\r\nUsing domain server:\r\nName: 8.8.8.8\r\nAddress: 8.8.8.8#53\r\nAliases: \r\n\r\n<a class=\"vglnk\" href=\"http:\/\/yahoo.com\/\" rel=\"nofollow\">yahoo.com<\/a> has address 192.168.20.200\r\n<\/code><\/pre>\n<\/div>\n<p style=\"text-align: justify;\">Windows\u4e0b\u76f4\u63a5\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95eeyahoo.com\uff0c\u9664\u975e\u88ab\u6d4f\u89c8\u5668\u7f13\u5b58\uff0c\u6b63\u5e38\u5e94\u8be5\u662f\u65e0\u6cd5\u8bbf\u95ee\u3002<\/p>\n<h1 style=\"text-align: justify;\"><span style=\"color: #000000; font-weight: bold;\">\u7ed3\u8bba<\/span><\/h1>\n<p style=\"text-align: justify;\">\u901a\u8fc7\u8bbe\u5b9aDNS\u91cd\u5b9a\u5411\u89c4\u5219\u53ef\u4ee5\u5c06\u5bf9\u5916\u90e8DNS\u7684\u8bf7\u6c42\u91cd\u5b9a\u5411\u5230\u914d\u7f6e\u7684Unbound DNS\u3001Pi-hole\u6216AdGuardHome\uff0c\u751a\u81f3\u53ef\u4ee5\u4f7f\u7528\u522b\u540d\u5c06DNS\u8bf7\u6c42\u968f\u673a\u91cd\u5b9a\u5411\u5230\u591a\u4e2a IP \u5730\u5740\uff0c\u4ece\u800c\u63d0\u5347\u8bbf\u95ee\u5916\u90e8\u7f51\u7edc\u65f6\u7684\u5b89\u5168\u6027\u3002<\/p>\n<p>\u539f\u6587<a href=\"https:\/\/homenetworkguy.com\/how-to\/redirect-all-dns-requests-to-local-dns-resolver\/\">\u5730\u5740<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u4e0d\u60f3\u8ba9\u9632\u706b\u5899\u540e\u9762\u7684\u5ba2\u6237\u7aef\u4f7f\u7528\u81ea\u5b9a\u4e49\u6216\u5176\u4ed6\u516c\u5171DNS\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u89c4\u5219\uff0c\u5c06\u6240\u6709 &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=8343\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[153],"class_list":["post-8343","post","type-post","status-publish","format-standard","hentry","category-opnsense","tag-dns"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/8343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8343"}],"version-history":[{"count":1,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/8343\/revisions"}],"predecessor-version":[{"id":11962,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/8343\/revisions\/11962"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}