{"id":477484,"date":"2023-08-09T09:15:39","date_gmt":"2023-08-09T09:15:39","guid":{"rendered":""},"modified":"2023-09-05T11:14:49","modified_gmt":"2023-09-05T11:14:49","slug":"hosts-file","status":"publish","type":"wiki","link":"https:\/\/oneproxy.pro\/cn\/wiki\/hosts-file\/","title":{"rendered":"\u4e3b\u673a\u6587\u4ef6"},"content":{"rendered":"<p>Hosts \u6587\u4ef6\u662f\u8ba1\u7b97\u673a\u7f51\u7edc\u4e2d\u57df\u540d\u7cfb\u7edf (DNS) \u7684\u57fa\u672c\u7ec4\u6210\u90e8\u5206\u3002\u5b83\u5145\u5f53\u4e00\u4e2a\u7b80\u5355\u7684\u6587\u672c\u6587\u4ef6\uff0c\u5c06\u4e3b\u673a\u540d\u6620\u5c04\u5230\u76f8\u5e94\u7684 IP \u5730\u5740\u3002\u5f53\u7528\u6237\u8bbf\u95ee\u7f51\u7ad9\u65f6\uff0c\u8ba1\u7b97\u673a\u9996\u5148\u68c0\u67e5 Hosts \u6587\u4ef6\u4ee5\u67e5\u770b\u4e3b\u673a\u540d\u662f\u5426\u5728\u5176\u4e2d\u5217\u51fa\uff0c\u7136\u540e\u518d\u67e5\u8be2 DNS \u670d\u52a1\u5668\u3002\u5982\u679c\u5728 Hosts \u6587\u4ef6\u4e2d\u627e\u5230\u4e3b\u673a\u540d\uff0c\u5219\u4f7f\u7528\u5173\u8054\u7684 IP \u5730\u5740\u8fde\u63a5\u5230\u7f51\u7ad9\u3002\u8fd9\u79cd\u673a\u5236\u5141\u8bb8\u7528\u6237\u8986\u76d6\u9ed8\u8ba4\u7684 DNS \u89e3\u6790\u8fc7\u7a0b\u5e76\u63a7\u5236\u7279\u5b9a\u57df\u540d\u7684\u89e3\u6790\u65b9\u5f0f\u3002<\/p>\n<h2>Hosts \u6587\u4ef6\u7684\u8d77\u6e90\u548c\u9996\u6b21\u63d0\u53ca\u7684\u5386\u53f2<\/h2>\n<p>Hosts \u6587\u4ef6\u7684\u6982\u5ff5\u53ef\u4ee5\u8ffd\u6eaf\u5230\u73b0\u4ee3\u4e92\u8054\u7f51\u7684\u524d\u8eab ARPANET \u7684\u65e9\u671f\u3002 20 \u4e16\u7eaa 70 \u5e74\u4ee3\uff0c\u521b\u5efa\u4e86\u7b2c\u4e00\u4e2a\u7248\u672c\u7684 ARPANET \u4e3b\u673a\u8868\uff0c\u5b83\u5145\u5f53\u4e3b\u673a\u540d\u5230 IP \u5730\u5740\u6620\u5c04\u7684\u4e2d\u592e\u5b58\u50a8\u5e93\u3002\u7136\u800c\uff0c\u968f\u7740\u4e3b\u673a\u6570\u91cf\u7684\u8fc5\u901f\u589e\u52a0\uff0c\u7ef4\u62a4\u96c6\u4e2d\u5f0f\u4e3b\u673a\u8868\u53d8\u5f97\u4e0d\u5207\u5b9e\u9645\u3002<\/p>\n<p>1983 \u5e74\uff0c\u57df\u540d\u7cfb\u7edf (DNS) \u88ab\u5f15\u5165\u6765\u53d6\u4ee3\u4e3b\u673a\u8868\uff0c\u5e76\u4e3a\u4e3b\u673a\u540d\u89e3\u6790\u63d0\u4f9b\u53ef\u6269\u5c55\u7684\u5206\u5e03\u5f0f\u89e3\u51b3\u65b9\u6848\u3002\u5c3d\u7ba1 DNS \u88ab\u5e7f\u6cdb\u91c7\u7528\uff0c\u4f46 Hosts \u6587\u4ef6\u4ece\u672a\u6d88\u5931\u3002\u76f8\u53cd\uff0c\u5b83\u4fdd\u7559\u5728\u5355\u4e2a\u8ba1\u7b97\u673a\u7cfb\u7edf\u4e0a\uff0c\u5e76\u7ee7\u7eed\u5728\u672c\u5730\u4e3b\u673a\u540d\u89e3\u6790\u4e2d\u53d1\u6325\u5173\u952e\u4f5c\u7528\u3002<\/p>\n<h2>\u6709\u5173 Hosts \u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f \u2013 \u6269\u5c55\u4e3b\u9898<\/h2>\n<p>Hosts \u6587\u4ef6\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u6587\u672c\u6587\u4ef6\uff0c\u901a\u5e38\u540d\u4e3a\u201chosts\u201d\uff0c\u5b58\u5728\u4e8e\u5927\u591a\u6570\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u5305\u62ec Windows\u3001macOS \u548c Linux\u3002\u5b83\u4f4d\u4e8e\u7cfb\u7edf\u76ee\u5f55\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u57fa\u672c\u6587\u672c\u7f16\u8f91\u5668\u8fdb\u884c\u7f16\u8f91\u3002 Hosts \u6587\u4ef6\u4e2d\u7684\u6bcf\u4e00\u884c\u4ee3\u8868\u4e3b\u673a\u540d\u548c IP \u5730\u5740\u4e4b\u95f4\u7684\u6620\u5c04\uff0c\u5176\u4e2d\u591a\u5217\u7531\u7a7a\u683c\u6216\u5236\u8868\u7b26\u5206\u9694\u3002<\/p>\n<p>Hosts \u6587\u4ef6\u6761\u76ee\u7684\u57fa\u672c\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<pre><div class=\"bg-black rounded-md mb-4\"><div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><span>\u5df4\u4ec0<\/span><button class=\"flex ml-auto gap-2\"><svg stroke=\"currentColor\" fill=\"none\" stroke-width=\"2\" viewbox=\"0 0 24 24\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\" height=\"1em\" width=\"1em\" ><path d=\"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\"><\/path><rect x=\"8\" y=\"2\" width=\"8\" height=\"4\" rx=\"1\" ry=\"1\"><\/rect><\/svg>\u590d\u5236\u4ee3\u7801<\/button><\/div><div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\" data-no-translation=\"\">IP_address   Hostname   <span class=\"hljs-comment\">#Optional_comment<\/span>\n<\/code><\/div><\/div><\/pre>\n<ul>\n<li><code data-no-translation=\"\">IP_address<\/code>\uff1a\u4e3b\u673a\u540d\u5c06\u6620\u5c04\u5230\u7684 IP \u5730\u5740\u3002<\/li>\n<li><code data-no-translation=\"\">Hostname<\/code>\uff1a\u5c06\u4e0e\u7ed9\u5b9a IP \u5730\u5740\u5173\u8054\u7684\u57df\u540d\u6216\u4e3b\u673a\u540d\u3002<\/li>\n<li><code data-no-translation=\"\">Optional_comment<\/code>\uff1a\u53ef\u9009\u6ce8\u91ca\uff0c\u63d0\u4f9b\u6709\u5173\u6761\u76ee\u7684\u9644\u52a0\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre><div class=\"bg-black rounded-md mb-4\"><div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><button class=\"flex ml-auto gap-2\"><svg stroke=\"currentColor\" fill=\"none\" stroke-width=\"2\" viewbox=\"0 0 24 24\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"h-4 w-4\" height=\"1em\" width=\"1em\" ><path d=\"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\"><\/path><rect x=\"8\" y=\"2\" width=\"8\" height=\"4\" rx=\"1\" ry=\"1\"><\/rect><\/svg>\u590d\u5236\u4ee3\u7801<\/button><\/div><div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\" data-no-translation=\"\">127.0.0.1       localhost\n<\/code><\/div><\/div><\/pre>\n<p>\u5728\u6b64\u793a\u4f8b\u4e2d\uff0cIP \u5730\u5740 127.0.0.1 \u6620\u5c04\u5230\u4e3b\u673a\u540d\u201clocalhost\u201d\u3002<\/p>\n<h2>Hosts \u6587\u4ef6\u7684\u5185\u90e8\u7ed3\u6784\u53ca\u5176\u5de5\u4f5c\u539f\u7406<\/h2>\n<p>\u5f53\u7528\u6237\u5c1d\u8bd5\u8bbf\u95ee\u7f51\u7ad9\u65f6\uff0c\u8ba1\u7b97\u673a\u5728\u67e5\u8be2 DNS \u670d\u52a1\u5668\u4e4b\u524d\u9996\u5148\u68c0\u67e5 Hosts \u6587\u4ef6\u3002\u5982\u679c\u5728 Hosts \u6587\u4ef6\u4e2d\u627e\u5230\u4e3b\u673a\u540d\uff0c\u5219\u4f7f\u7528\u76f8\u5e94\u7684 IP \u5730\u5740\u4e0e\u7f51\u7ad9\u5efa\u7acb\u8fde\u63a5\u3002\u5982\u679c\u4e3b\u673a\u540d\u4e0d\u5b58\u5728\u4e8e Hosts \u6587\u4ef6\u4e2d\uff0c\u8ba1\u7b97\u673a\u5c06\u7ee7\u7eed\u6267\u884c\u9ed8\u8ba4 DNS \u89e3\u6790\u8fc7\u7a0b\u6765\u83b7\u53d6 IP \u5730\u5740\u3002<\/p>\n<p>Hosts \u6587\u4ef6\u9075\u5faa\u7b80\u5355\u7684\u4f18\u5148\u7ea7\u539f\u5219\u3002\u6587\u4ef6\u9876\u90e8\u7684\u6761\u76ee\u4f18\u5148\u4e8e\u4e0b\u65b9\u7684\u6761\u76ee\u3002\u8fd9\u610f\u5473\u7740\uff0c\u5982\u679c\u591a\u6b21\u5217\u51fa\u5177\u6709\u4e0d\u540c IP \u5730\u5740\u7684\u4e3b\u673a\u540d\uff0c\u5219\u5c06\u4f7f\u7528\u9047\u5230\u7684\u7b2c\u4e00\u4e2a\u6761\u76ee\u4e2d\u7684 IP \u5730\u5740\u3002<\/p>\n<p>\u8bf7\u52a1\u5fc5\u6ce8\u610f\uff0cHosts \u6587\u4ef6\u4e2d\u7684\u9519\u8bef\u914d\u7f6e\u53ef\u80fd\u4f1a\u5bfc\u81f4\u8bbf\u95ee\u7f51\u7ad9\u65f6\u51fa\u73b0\u95ee\u9898\uff0c\u56e0\u4e3a\u9519\u8bef\u7684\u6620\u5c04\u53ef\u80fd\u4f1a\u963b\u6b62\u6b63\u786e\u7684 DNS \u89e3\u6790\u3002<\/p>\n<h2>Hosts\u6587\u4ef6\u4e3b\u8981\u7279\u5f81\u5206\u6790<\/h2>\n<p>Hosts \u6587\u4ef6\u63d0\u4f9b\u4e86\u51e0\u4e2a\u5173\u952e\u529f\u80fd\u548c\u4f18\u70b9\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u672c\u5730\u8986\u76d6<\/strong>\uff1a\u7528\u6237\u53ef\u4ee5\u5728\u672c\u5730\u8986\u76d6 DNS \u89e3\u6790\uff0c\u4ece\u800c\u963b\u6b62\u5bf9\u7279\u5b9a\u7f51\u7ad9\u7684\u8bbf\u95ee\u6216\u5c06\u67d0\u4e9b\u57df\u91cd\u5b9a\u5411\u5230\u5907\u7528 IP \u5730\u5740\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u79bb\u7ebf\u6d4b\u8bd5<\/strong>\uff1aWeb\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u4f7f\u7528Hosts\u6587\u4ef6\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u6d4b\u8bd5\u7f51\u7ad9\uff0c\u800c\u65e0\u9700\u4fee\u6539DNS\u8bb0\u5f55\uff0c\u8fd9\u5bf9\u4e8e\u79bb\u7ebf\u6d4b\u8bd5\u548c\u8c03\u8bd5\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u5168\u548c\u9690\u79c1<\/strong>\uff1a\u901a\u8fc7 Hosts \u6587\u4ef6\u963b\u6b62\u5bf9\u6076\u610f\u7f51\u7ad9\u7684\u8bbf\u95ee\uff0c\u7528\u6237\u53ef\u4ee5\u589e\u5f3a\u5728\u7ebf\u5b89\u5168\u548c\u9690\u79c1\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u901f\u5ea6<\/strong>\uff1a\u7531\u4e8e\u5728\u67e5\u8be2 DNS \u670d\u52a1\u5668\u4e4b\u524d\u4f1a\u68c0\u67e5 Hosts \u6587\u4ef6\uff0c\u56e0\u6b64\u53ef\u4ee5\u4e3a\u7ecf\u5e38\u8bbf\u95ee\u7684\u7f51\u7ad9\u63d0\u4f9b\u66f4\u5feb\u7684\u4e3b\u673a\u540d\u89e3\u6790\u3002<\/p>\n<\/li>\n<\/ol>\n<h2>\u4e3b\u673a\u6587\u4ef6\u7684\u7c7b\u578b<\/h2>\n<p>Hosts \u6587\u4ef6\u6839\u636e\u5176\u4f4d\u7f6e\u548c\u7528\u9014\u53ef\u4ee5\u5206\u4e3a\u4e24\u79cd\u7c7b\u578b\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u7cfb\u7edf\u8303\u56f4\u7684\u4e3b\u673a\u6587\u4ef6<\/strong>\uff1a\u6b64\u7c7bHosts\u6587\u4ef6\u4f4d\u4e8e\u7cfb\u7edf\u76ee\u5f55\u4e0b\uff0c\u5168\u5c40\u9002\u7528\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u7684\u6240\u6709\u7528\u6237\u3002\u5bf9\u6b64\u6587\u4ef6\u6240\u505a\u7684\u66f4\u6539\u4f1a\u5f71\u54cd\u6574\u4e2a\u7cfb\u7edf\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u7528\u6237\u7279\u5b9a\u7684\u4e3b\u673a\u6587\u4ef6<\/strong>\uff1a\u67d0\u4e9b\u64cd\u4f5c\u7cfb\u7edf\u5141\u8bb8\u7528\u6237\u62e5\u6709\u81ea\u5df1\u7684\u4e3b\u673a\u6587\u4ef6\uff0c\u901a\u5e38\u5b58\u50a8\u5728\u5176\u7528\u6237\u76ee\u5f55\u4e2d\u3002\u5bf9\u6b64\u6587\u4ef6\u6240\u505a\u7684\u66f4\u6539\u4ec5\u5f71\u54cd\u7279\u5b9a\u7528\u6237\u7684\u5e10\u6237\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u4e0b\u9762\u662f\u4e24\u79cd\u7c7b\u578b\u7684\u6bd4\u8f83\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th><\/th>\n<th>\u7cfb\u7edf\u8303\u56f4\u7684\u4e3b\u673a\u6587\u4ef6<\/th>\n<th>\u7528\u6237\u7279\u5b9a\u7684\u4e3b\u673a\u6587\u4ef6<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u5730\u70b9<\/td>\n<td>\u7cfb\u7edf\u76ee\u5f55<\/td>\n<td>\u7528\u6237\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u6027<\/td>\n<td>\u5168\u7403\u8303\u56f4<\/td>\n<td>\u4ec5\u9650\u4e8e\u7528\u6237<\/td>\n<\/tr>\n<tr>\n<td>\u7ba1\u7406\u8bbf\u95ee<\/td>\n<td>\u9700\u8981\u7ba1\u7406\u6743\u9650<\/td>\n<td>\u53ef\u7531\u7528\u6237\u4fee\u6539<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Hosts \u6587\u4ef6\u7684\u4f7f\u7528\u65b9\u6cd5\u3001\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848<\/h2>\n<h3>Hosts\u6587\u4ef6\u7684\u4f7f\u7528\u65b9\u6cd5\uff1a<\/h3>\n<ol>\n<li>\n<p><strong>\u7f51\u7ad9\u5c4f\u853d<\/strong>\uff1a\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5c06\u4e3b\u673a\u540d\u6620\u5c04\u5230\u73af\u56de IP \u5730\u5740\uff08\u4f8b\u5982 127.0.0.1 \u6216 0.0.0.0\uff09\u6765\u963b\u6b62\u8bbf\u95ee\u4e0d\u9700\u8981\u7684\u7f51\u7ad9\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u7f51\u7ad9\u91cd\u5b9a\u5411<\/strong>\uff1aHosts \u6587\u4ef6\u5141\u8bb8\u7528\u6237\u5c06\u7279\u5b9a\u57df\u91cd\u5b9a\u5411\u5230\u6240\u9700\u7684 IP \u5730\u5740\u3002\u8fd9\u5bf9\u4e8e\u5f00\u53d1\u6216\u7ed5\u8fc7\u533a\u57df\u9650\u5236\u5f88\u6709\u7528\u3002<\/p>\n<\/li>\n<\/ol>\n<h3>\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848\uff1a<\/h3>\n<ol>\n<li>\n<p><strong>\u4e0d\u6b63\u786e\u7684\u914d\u7f6e<\/strong>\uff1aHosts \u6587\u4ef6\u4e2d\u7684\u9519\u8bef\u6761\u76ee\u53ef\u80fd\u4f1a\u5bfc\u81f4\u8bbf\u95ee\u7f51\u7ad9\u65f6\u51fa\u73b0\u95ee\u9898\u6216\u5bfc\u81f4\u610f\u5916\u91cd\u5b9a\u5411\u3002\u4ed4\u7ec6\u5ba1\u67e5\u548c\u7f16\u8f91\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u7f13\u5b58\u95ee\u9898<\/strong>\uff1a\u5bf9 Hosts \u6587\u4ef6\u8fdb\u884c\u66f4\u6539\u540e\uff0c\u7531\u4e8e DNS \u7f13\u5b58\u7684\u539f\u56e0\uff0c\u66f4\u6539\u53ef\u80fd\u4e0d\u4f1a\u7acb\u5373\u751f\u6548\u3002\u6e05\u9664DNS\u7f13\u5b58\u6216\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\u53ef\u4ee5\u89e3\u51b3\u6b64\u95ee\u9898\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u64cd\u4f5c\u7cfb\u7edf\u9650\u5236<\/strong>\uff1a\u4e00\u4e9b\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf\u5b9e\u65bd\u4e86\u9650\u5236\u76f4\u63a5\u7f16\u8f91 Hosts \u6587\u4ef6\u7684\u5b89\u5168\u63aa\u65bd\u3002\u7528\u6237\u53ef\u80fd\u9700\u8981\u4fee\u6539\u6587\u4ef6\u6743\u9650\u6216\u4f7f\u7528\u7ba1\u7406\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n<\/li>\n<\/ol>\n<h2>\u4e3b\u8981\u7279\u70b9\u53ca\u540c\u7c7b\u4ea7\u54c1\u6bd4\u8f83<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u7279\u5f81<\/th>\n<th>\u4e3b\u673a\u6587\u4ef6<\/th>\n<th>DNS\uff08\u57df\u540d\u7cfb\u7edf\uff09<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u76ee\u7684<\/td>\n<td>\u672c\u5730\u4e3b\u673a\u540d\u89e3\u6790\u8986\u76d6<\/td>\n<td>\u5168\u7403\u57df\u540d\u89e3\u6790<\/td>\n<\/tr>\n<tr>\n<td>\u6587\u4ef6\u683c\u5f0f<\/td>\n<td>\u7b80\u5355\u7684\u6587\u672c\u6587\u4ef6<\/td>\n<td>\u5206\u5c42\u5206\u5e03\u5f0f\u6570\u636e\u5e93<\/td>\n<\/tr>\n<tr>\n<td>\u8303\u56f4<\/td>\n<td>\u4ec5\u9650\u4e8e\u672c\u5730\u7cfb\u7edf<\/td>\n<td>\u5168\u7403\u3001\u4e92\u8054\u7f51\u8303\u56f4<\/td>\n<\/tr>\n<tr>\n<td>\u5206\u8fa8\u7387\u4f18\u5148\u7ea7<\/td>\n<td>\u4f18\u5148\u7ea7\u9ad8\u4e8e DNS \u89e3\u6790<\/td>\n<td>Hosts \u6587\u4ef6\u89e3\u6790\u5931\u8d25\u65f6\u4f7f\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u96c6\u6743<\/td>\n<td>\u5206\u6563\u7684\u4e2a\u4eba\u6587\u4ef6<\/td>\n<td>\u96c6\u4e2d\u4e8e\u591a\u4e2a\u670d\u52a1\u5668<\/td>\n<\/tr>\n<tr>\n<td>\u5b9a\u5236\u53ef\u80fd\u6027<\/td>\n<td>\u9ad8\u5ea6\u53ef\u5b9a\u5236\uff0c\u9002\u5408\u672c\u5730\u4f7f\u7528<\/td>\n<td>\u6700\u7ec8\u7528\u6237\u7684\u5b9a\u5236\u6709\u9650<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u4e0e Hosts \u6587\u4ef6\u76f8\u5173\u7684\u672a\u6765\u524d\u666f\u548c\u6280\u672f<\/h2>\n<p>Hosts \u6587\u4ef6\u591a\u5e74\u6765\u4e00\u76f4\u4fdd\u6301\u5176\u76f8\u5173\u6027\uff0c\u7279\u522b\u662f\u5728\u9700\u8981\u5bf9\u4e3b\u673a\u540d\u89e3\u6790\u8fdb\u884c\u7ec6\u7c92\u5ea6\u63a7\u5236\u7684\u60c5\u51b5\u4e0b\u3002\u968f\u7740\u4e92\u8054\u7f51\u7684\u4e0d\u65ad\u53d1\u5c55\uff0cHosts \u6587\u4ef6\u6709\u671b\u4e0e DNS \u548c\u5176\u4ed6\u9ad8\u7ea7\u89e3\u6790\u6280\u672f\u5171\u5b58\u3002\u4e0e Hosts \u6587\u4ef6\u76f8\u5173\u7684\u6f5c\u5728\u6539\u8fdb\u53ef\u80fd\u5305\u62ec\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u4e0e\u5b89\u5168\u89e3\u51b3\u65b9\u6848\u96c6\u6210<\/strong>\uff1a\u4e3b\u673a\u6587\u4ef6\u53ef\u4ee5\u96c6\u6210\u5230\u9ad8\u7ea7\u5b89\u5168\u89e3\u51b3\u65b9\u6848\u4e2d\uff0c\u4ee5\u63d0\u4f9b\u9488\u5bf9\u7f51\u7edc\u9493\u9c7c\u548c\u6076\u610f\u8f6f\u4ef6\u7684\u589e\u5f3a\u4fdd\u62a4\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u53bb\u4e2d\u5fc3\u5316\u57df\u540d\u7cfb\u7edf<\/strong>\uff1a\u968f\u7740\u533a\u5757\u94fe\u7b49\u53bb\u4e2d\u5fc3\u5316\u6280\u672f\u7684\u5174\u8d77\uff0c\u4e3b\u673a\u6587\u4ef6\u6982\u5ff5\u53ef\u4ee5\u6269\u5c55\u5230\u652f\u6301\u53bb\u4e2d\u5fc3\u5316\u57df\u540d\u89e3\u6790\u3002<\/p>\n<\/li>\n<\/ol>\n<h2>\u5982\u4f55\u4f7f\u7528\u4ee3\u7406\u670d\u52a1\u5668\u6216\u5982\u4f55\u5c06\u4ee3\u7406\u670d\u52a1\u5668\u4e0e\u4e3b\u673a\u6587\u4ef6\u5173\u8054<\/h2>\n<p>\u4ee3\u7406\u670d\u52a1\u5668\u53ef\u4ee5\u4e0e Hosts \u6587\u4ef6\u7ed3\u5408\u4f7f\u7528\u6765\u5b9e\u73b0\u5404\u79cd\u76ee\u6807\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u8bbf\u95ee\u63a7\u5236<\/strong>\uff1a\u4ee3\u7406\u670d\u52a1\u5668\u53ef\u4ee5\u6839\u636e Hosts \u6587\u4ef6\u6761\u76ee\u8fc7\u6ee4\u8bf7\u6c42\uff0c\u5141\u8bb8\u6216\u963b\u6b62\u7528\u6237\u8bbf\u95ee\u7279\u5b9a\u7f51\u7ad9\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5730\u7406\u5b9a\u4f4d\u7ed5\u8fc7<\/strong>\uff1a\u901a\u8fc7\u914d\u7f6eHosts\u6587\u4ef6\u5e76\u4f7f\u7528\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u7528\u6237\u53ef\u4ee5\u7ed5\u8fc7\u5730\u7406\u4f4d\u7f6e\u9650\u5236\u5e76\u8bbf\u95ee\u533a\u57df\u9650\u5236\u7684\u5185\u5bb9\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u8d1f\u8f7d\u5747\u8861<\/strong>\uff1a\u4ee3\u7406\u670d\u52a1\u5668\u53ef\u4ee5\u4f7f\u7528Hosts\u6587\u4ef6\u5728\u591a\u4e2a\u540e\u7aef\u670d\u52a1\u5668\u4e4b\u95f4\u5206\u914d\u6d41\u91cf\uff0c\u4ece\u800c\u63d0\u9ad8\u6027\u80fd\u548c\u53ef\u9760\u6027\u3002<\/p>\n<\/li>\n<\/ol>\n<h2>\u76f8\u5173\u94fe\u63a5<\/h2>\n<p>\u6709\u5173 Hosts \u6587\u4ef6\u548c\u76f8\u5173\u4e3b\u9898\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u4ee5\u4e0b\u8d44\u6e90\uff1a<\/p>\n<ol>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Hosts_(file)\" target=\"_new\" rel=\"noopener nofollow\">\u7ef4\u57fa\u767e\u79d1 \u2013 \u4e3b\u673a\u6587\u4ef6<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/troubleshoot\/windows-server\/networking\/manage-the-hosts-file\" target=\"_new\" rel=\"noopener nofollow\">Microsoft Docs \u2013 \u7ba1\u7406 Hosts \u6587\u4ef6<\/a><\/li>\n<li><a href=\"https:\/\/geekflare.com\/hosts-file-usage\/\" target=\"_new\" rel=\"noopener nofollow\">Geekflare \u2013 \u5982\u4f55\u4f7f\u7528 Hosts \u6587\u4ef6\uff08\u5e26\u6709\u793a\u4f8b\uff09<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudflare.com\/learning\/dns\/what-is-dns\/\" target=\"_new\" rel=\"noopener nofollow\">DNS \u89e3\u91ca<\/a><\/li>\n<\/ol>","protected":false},"featured_media":477485,"menu_order":0,"template":"","meta":{"_acf_changed":false,"content-type":"","inline_featured_image":false,"footnotes":""},"class_list":["post-477484","wiki","type-wiki","status-publish","has-post-thumbnail","hentry"],"acf":{"faq_title":"Frequently Asked Questions about <mark>Hosts file for Proxy Server Provider OneProxy (oneproxy.pro)<\/mark>","faq_items":[{"question":"What is the Hosts file, and how does it work?","answer":"<p>The Hosts file is a text file on your computer that maps hostnames to their corresponding IP addresses. When you access a website, your computer checks the Hosts file before querying a DNS server. If the hostname is found in the file, the associated IP address is used to connect to the website.<\/p>"},{"question":"What is the history of the Hosts file?","answer":"<p>The Hosts file has its origins in the early days of ARPANET, the precursor to the modern internet. It was later replaced by the Domain Name System (DNS) in 1983 but continued to be used on individual systems for local hostname resolution.<\/p>"},{"question":"How is the Hosts file structured, and what does an entry look like?","answer":"<p>The Hosts file offers local overrides, offline testing capabilities, enhanced security, and potential speed improvements for frequently accessed websites.<\/p>"},{"question":"What are the key features of the Hosts file?","answer":"<p>There are two types of Hosts files: system-wide and user-specific. The system-wide file applies globally to all users, while the user-specific file affects only the specific user's account.<\/p>"},{"question":"What are the types of Hosts files, and how do they differ?","answer":"<p>You can use the Hosts file to block unwanted websites or redirect domains to specific IP addresses. However, incorrect configurations can lead to problems accessing websites. Clearing the DNS cache or restarting your system can help resolve some issues.<\/p>"},{"question":"How can I use the Hosts file, and what problems might arise?","answer":"<p>The Hosts file provides local hostname resolution override, while DNS offers global domain name resolution. The Hosts file takes precedence over DNS resolution, making it useful for customizations on a local level.<\/p>"},{"question":"How does the Hosts file compare to DNS?","answer":"<p>As the internet evolves, the Hosts file is expected to coexist with advanced resolution technologies. It may find integration with security solutions and potentially support decentralized domain name resolution.<\/p>"},{"question":"What does the future hold for the Hosts file?","answer":"<p>Proxy servers can work alongside the Hosts file for access control, geolocation bypass, and load balancing, enhancing network performance and security.<\/p>"},{"question":"How can proxy servers be associated with the Hosts file?","answer":""}]},"_links":{"self":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/wiki\/477484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/wiki"}],"about":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/types\/wiki"}],"version-history":[{"count":0,"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/wiki\/477484\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/media\/477485"}],"wp:attachment":[{"href":"https:\/\/oneproxy.pro\/cn\/wp-json\/wp\/v2\/media?parent=477484"}],"curies":[{"name":"\u53ef\u6e7f\u6027\u7c89\u5242","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}