{"id":76804,"date":"2023-08-26T01:39:17","date_gmt":"2023-08-25T17:39:17","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=76804"},"modified":"2023-08-26T01:39:17","modified_gmt":"2023-08-25T17:39:17","slug":"dnsmasq-dns","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/dnsmasq-dns.html","title":{"rendered":"dnsmasq\u914d\u7f6edns\u5b9e\u6218"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u7b2c\u4e00\u6b21\u7528\u8fd9\u4e2a\u5c0f\u8f6f\u4ef6\uff0c\u611f\u89c9\u8fd8\u4e0d\u9519\uff0c\u56e0\u4e3a\u6ca1\u6709\u50cfbind\u90a3\u6837\u914d\u7f6e\u8d77\u6765\u7e41\u7410\uff0c\u5e76\u4e14\u6211\u4eec\u4e5f\u4e0d\u9700\u8981\u53bb\u914d\u7f6e\u5f88\u591a\u6587\u4ef6\uff0c\u5185\u5916\u7f51\u8bbf\u95ee\u4e92\u4e0d\u5e72\u6d89\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n dnsmasq\u5148\u53bb\u89e3\u6790hosts\u6587\u4ef6\uff0c \u518d\u53bb\u89e3\u6790\/etc\/dnsmasq.d\/\u4e0b\u7684*.conf\u6587\u4ef6\uff0c\u5e76\u4e14\u8fd9\u4e9b\u6587\u4ef6\u7684\u4f18\u5148\u7ea7\u8981\u9ad8\u4e8ednsmasq.conf\uff0c\u6211\u4eec\u81ea\u5b9a\u4e49\u7684resolv.dnsmasq.conf\u4e2d\u7684DNS\u4e5f\u88ab\u79f0\u4e3a\u4e0a\u6e38DNS\uff0c\u8fd9\u662f\u6700\u540e\u53bb\u67e5\u8be2\u89e3\u6790\u7684\uff1b<\/p>\n \u5982\u679c\u4e0d\u60f3\u7528hosts\u6587\u4ef6\u505a\u89e3\u6790\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\/etc\/dnsmasq.conf\u4e2d\u52a0\u5165no-hosts\u8fd9\u6761\u8bed\u53e5\uff0c\u8fd9\u6837\u7684\u8bdd\u5c31\u76f4\u63a5\u67e5\u8be2\u4e0a\u6e38DNS\u4e86\uff0c\u5982\u679c\u6211\u4eec\u4e0d\u60f3\u505a\u4e0a\u6e38\u67e5\u8be2\uff0c\u5c31\u662f\u4e0d\u60f3\u505a\u6b63\u5e38\u7684\u89e3\u6790\uff0c\u6211\u4eec\u53ef\u4ee5\u52a0\u5165no-reslov\u8fd9\u6761\u8bed\u53e5\u3002<\/p>\n bind\u8fd9\u4e2aDNS\u592a\u5e9e\u5927\u4e86\uff0c\u5982\u679c\u4e00\u4e2a\u90e8\u95e8\u6216\u8005\u662f\u670d\u52a1\u8303\u56f4\u6bd4\u8f83\u5c0f\u7684\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u7528dnsmasq\u5b8c\u5168\u53ef\u4ee5\uff0c\u6bd5\u7adf\u914d\u7f6e\u8d77\u6765\u7b80\u5355\u65b9\u4fbf\uff0cdnsmasq\u5c31\u7528\u6765\u6211\u4eec\u516c\u53f8\u5185\u90e8\u57df\u540d\u548c\u516c\u7f51\u57df\u540d\u5b58\u5728\u51b2\u7a81\u6216\u8005\u662f\u81ea\u5df1\u7684\u57df\u540d\u6bd4\u8f83\u7279\u522b\u7684\u8bdd\u7528\u8d77\u6765\u6bd4\u8f83\u597d\uff0c\u4e5f\u4e0d\u5f71\u54cd\u6b63\u5e38\u7684\u5916\u7f51\u89e3\u6790\u3002<\/p>\n 1.\u76f4\u63a5\u4f7f\u7528yum\u5b89\u88c5\uff0c\u5e76\u4e14\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f,\u5173\u95edSELinux<\/strong><\/div>\n [root@localhost ]# yum install dnsmasq* -y\r\n\r\n[root@localhost ]# chkconfig dnsmasq on\r\n<\/pre>\n |