{"id":16068,"date":"2026-06-21T11:38:49","date_gmt":"2026-06-21T03:38:49","guid":{"rendered":"https:\/\/pfchina.org\/?p=16068"},"modified":"2026-06-21T14:24:14","modified_gmt":"2026-06-21T06:24:14","slug":"%e4%b8%ba-ipfire-%e5%8a%a8%e6%80%81-dns-%e5%a2%9e%e5%8a%a0-cloudflare%e3%80%81%e9%98%bf%e9%87%8c%e4%ba%91%e5%92%8c%e8%85%be%e8%ae%af%e4%ba%91%e5%9f%9f%e5%90%8d%e8%a7%a3%e6%9e%90%e6%94%af%e6%8c%81","status":"publish","type":"post","link":"https:\/\/pfchina.org\/?p=16068","title":{"rendered":"IPFire \u589e\u52a0 Cloudflare\u3001\u963f\u91cc\u4e91\u548c\u817e\u8baf\u4e91\u52a8\u6001\u57df\u540d\u89e3\u6790\u652f\u6301"},"content":{"rendered":"<p style=\"text-align: justify;\">IPFire \u81ea\u5e26\u52a8\u6001 DNS \u529f\u80fd\uff0c\u53ef\u4ee5\u5728\u516c\u7f51 IP \u53d8\u5316\u540e\u81ea\u52a8\u66f4\u65b0\u57df\u540d\u89e3\u6790\u8bb0\u5f55\u3002\u4e0d\u8fc7\u5728\u9ed8\u8ba4\u652f\u6301\u7684\u670d\u52a1\u5546\u5217\u8868\u4e2d\uff0c\u5e76\u6ca1\u6709 Cloudflare\u3001\u963f\u91cc\u4e91\u548c\u817e\u8baf\u4e91 DNSPod\u3002\u5bf9\u4e8e\u56fd\u5185\u7f51\u7edc\u73af\u5883\uff0c\u963f\u91cc\u4e91\u548c\u817e\u8baf\u4e91 DNSPod \u4f7f\u7528\u975e\u5e38\u666e\u904d\uff1b\u800c Cloudflare \u4e5f\u662f\u5f88\u591a\u7ad9\u70b9\u5e38\u7528\u7684 DNS \u6258\u7ba1\u670d\u52a1\u3002<\/p>\n<p style=\"text-align: justify;\">\u501f\u52a9AI\u5de5\u5177\uff0c\u6211\u7ed9 IPFire \u7684 <code>ddns<\/code> \u7ec4\u4ef6\u589e\u52a0\u4e86\u4e09\u4e2a\u65b0\u7684 DNS \u670d\u52a1\u5546\u652f\u6301\uff1a<\/p>\n<pre><code>cloudflare.com\r\nalidns.aliyuncs.com\r\ndnspod.tencentcloudapi.com<\/code><\/pre>\n<p style=\"text-align: justify;\">\u76f4\u63a5\u5728 IPFire \u7684 Web \u9875\u9762\u4e2d\u6dfb\u52a0\u8fd9\u4e9b\u670d\u52a1\u5546\uff0c\u5b9e\u73b0\u516c\u7f51 IP \u53d8\u5316\u540e\u7684\u81ea\u52a8\u89e3\u6790\u66f4\u65b0\u3002<\/p>\n<h2 style=\"text-align: justify;\">\u5b9e\u73b0\u601d\u8def<\/h2>\n<p style=\"text-align: justify;\">IPFire \u7684\u52a8\u6001 DNS \u9875\u9762\u662f\uff1a<\/p>\n<pre><code>\/srv\/web\/ipfire\/cgi-bin\/ddns.cgi<\/code><\/pre>\n<p style=\"text-align: justify;\">\u4f46\u8fd9\u4e2a\u9875\u9762\u672c\u8eab\u5e76\u4e0d\u771f\u6b63\u6267\u884c DNS \u66f4\u65b0\u3002\u5b83\u4e3b\u8981\u8d1f\u8d23\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u5c55\u793a\u652f\u6301\u7684 DDNS \u670d\u52a1\u5546\u5217\u8868<\/li>\n<li>\u4fdd\u5b58\u4e3b\u673a\u540d\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801\u6216 Token<\/li>\n<li>\u751f\u6210 <code>\/var\/ipfire\/ddns\/ddns.conf<\/code><\/li>\n<li>\u8c03\u7528\u540e\u7aef <code>\/usr\/bin\/ddns<\/code> \u8fdb\u884c\u66f4\u65b0<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\u771f\u6b63\u7684\u52a8\u6001 DNS \u66f4\u65b0\u903b\u8f91\u5728 Python \u5305\u4e2d\uff1a<\/p>\n<pre><code>\/usr\/lib\/python3.10\/site-packages\/ddns\/<\/code><\/pre>\n<p style=\"text-align: justify;\">\u4e3b\u8981\u6d89\u53ca\u4e24\u4e2a\u6587\u4ef6\uff1a<\/p>\n<pre><code>providers.py\r\nsystem.py<\/code><\/pre>\n<p style=\"text-align: justify;\">\u5176\u4e2d\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li><code>providers.py<\/code> \u5b9a\u4e49\u5404\u4e2a DDNS \u670d\u52a1\u5546<\/li>\n<li><code>system.py<\/code> \u8d1f\u8d23\u53d1\u9001 HTTP \u8bf7\u6c42<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\u6539\u52a8\u7684\u6838\u5fc3\uff1a<\/p>\n<ol style=\"text-align: justify;\" start=\"1\">\n<li>\u7ed9 <code>system.py<\/code> \u589e\u52a0\u81ea\u5b9a\u4e49 HTTP Header\u3001PATCH\u3001DELETE \u7b49\u8bf7\u6c42\u80fd\u529b<\/li>\n<li>\u5728 <code>providers.py<\/code> \u4e2d\u589e\u52a0 Cloudflare\u3001\u963f\u91cc\u4e91\u3001\u817e\u8baf\u4e91 DNSPod Provider<\/li>\n<li>\u5728 <code>lfs\/ddns<\/code> \u4e2d\u52a0\u5165\u6784\u5efa\u8865\u4e01<\/li>\n<\/ol>\n<h2 style=\"text-align: justify;\">\u5b89\u88c5\u65b9\u6cd5<\/h2>\n<p style=\"text-align: justify;\">\u8865\u4e01\u5305\u76ee\u5f55\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<pre><code>cloudflare patch\/\r\n\u251c\u2500\u2500 install.sh\r\n\u251c\u2500\u2500 uninstall.sh\r\n\u251c\u2500\u2500 README.md\r\n\u251c\u2500\u2500 README.cn.md\r\n\u251c\u2500\u2500 ipfire-ddns-cloudflare.patch\r\n\u2514\u2500\u2500 src\/patches\/ddns-014-dns-provider-support.patch<\/code><\/pre>\n<p style=\"text-align: justify;\">\u628a\u6574\u4e2a <code>cloudflare patch<\/code> \u6587\u4ef6\u5939\u590d\u5236\u5230 IPFire \u4e3b\u673a\u4e0a\uff0c\u7136\u540e\u6267\u884c\uff1a<\/p>\n<pre><code>chmod +x install.sh uninstall.sh\r\n.\/install.sh<\/code><\/pre>\n<p style=\"text-align: justify;\">\u5b89\u88c5\u811a\u672c\u4f1a\u81ea\u52a8\u5b8c\u6210\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u5907\u4efd\u5f53\u524d <code>providers.py<\/code><\/li>\n<li>\u5907\u4efd\u5f53\u524d <code>system.py<\/code><\/li>\n<li>\u5e94\u7528 DNS Provider \u8865\u4e01<\/li>\n<li>\u6267\u884c Python \u8bed\u6cd5\u68c0\u67e5<\/li>\n<li>\u9a8c\u8bc1\u65b0\u670d\u52a1\u5546\u662f\u5426\u5df2\u7ecf\u88ab <code>\/usr\/bin\/ddns<\/code> \u8bc6\u522b<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\u9ed8\u8ba4\u5b89\u88c5\u8def\u5f84\u4e3a\uff1a<\/p>\n<pre><code>\/usr\/lib\/python3.10\/site-packages\/ddns<\/code><\/pre>\n<p style=\"text-align: justify;\">\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u8def\u5f84\u4e0d\u540c\uff0c\u4e5f\u53ef\u4ee5\u624b\u52a8\u6307\u5b9a\uff1a<\/p>\n<pre><code>DDNS_DIR=\/path\/to\/ddns .\/install.sh<\/code><\/pre>\n<h2 style=\"text-align: justify;\">\u914d\u7f6e\u65b9\u6cd5<\/h2>\n<h3 style=\"text-align: justify;\">Cloudflare<\/h3>\n<p style=\"text-align: justify;\">Cloudflare \u4f7f\u7528 API Token \u8ba4\u8bc1\u3002<\/p>\n<p style=\"text-align: justify;\">\u5728 IPFire \u9875\u9762\u4e2d\u9009\u62e9\uff1a<\/p>\n<pre><code>cloudflare.com<\/code><\/pre>\n<p style=\"text-align: justify;\">\u586b\u5199\u65b9\u5f0f\uff1a<\/p>\n<pre><code>\u4e3b\u673a\u540d\uff1a\u5b8c\u6574\u57df\u540d\uff0c\u4f8b\u5982 test.example.com\r\n\u4ee4\u724c\uff1aCloudflare API Token<\/code><\/pre>\n<p style=\"text-align: justify;\">Cloudflare Token \u9700\u8981\u5bf9\u5e94 Zone \u7684 DNS \u7f16\u8f91\u6743\u9650\u3002<\/p>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/cloudflare.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/cloudflare.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" \/><\/div><\/p>\n<h3 style=\"text-align: justify;\">\u963f\u91cc\u4e91<\/h3>\n<p style=\"text-align: justify;\">\u963f\u91cc\u4e91\u4f7f\u7528 AccessKey \u8ba4\u8bc1\u3002<\/p>\n<p style=\"text-align: justify;\">\u5728 IPFire \u9875\u9762\u4e2d\u9009\u62e9\uff1a<\/p>\n<pre><code>alidns.aliyuncs.com<\/code><\/pre>\n<p style=\"text-align: justify;\">\u586b\u5199\u65b9\u5f0f\uff1a<\/p>\n<pre><code>\u4e3b\u673a\u540d\uff1a\u5b8c\u6574\u57df\u540d\uff0c\u4f8b\u5982 test.example.com\r\n\u7528\u6237\u540d\uff1aAccessKeyId\r\n\u5bc6\u7801\uff1aAccessKeySecret<\/code><\/pre>\n<p style=\"text-align: justify;\">\u5bf9\u5e94\u7528\u6237\u9700\u8981\u5177\u5907\u67e5\u8be2\u3001\u65b0\u589e\u3001\u66f4\u65b0\u4e91\u89e3\u6790 DNS \u8bb0\u5f55\u7684\u6743\u9650\u3002<\/p>\n<p><a href=\"https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/alidns.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/alidns.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-16074\" data-original=\"https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/alidns.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" width=\"1926\" height=\"394\" \/><\/div><\/a><\/p>\n<h3 style=\"text-align: justify;\">\u817e\u8baf\u4e91<\/h3>\n<p style=\"text-align: justify;\">\u817e\u8baf\u4e91 DNSPod \u4f7f\u7528 SecretId \u548c SecretKey \u8ba4\u8bc1\u3002<\/p>\n<p style=\"text-align: justify;\">\u5728 IPFire \u9875\u9762\u4e2d\u9009\u62e9\uff1a<\/p>\n<pre><code>dnspod.tencentcloudapi.com<\/code><\/pre>\n<p style=\"text-align: justify;\">\u586b\u5199\u65b9\u5f0f\uff1a<\/p>\n<pre><code>\u4e3b\u673a\u540d\uff1a\u5b8c\u6574\u57df\u540d\uff0c\u4f8b\u5982 test.example.com\r\n\u7528\u6237\u540d\uff1aSecretId\r\n\u5bc6\u7801\uff1aSecretKey<\/code><\/pre>\n<p style=\"text-align: justify;\">\u5bf9\u5e94 \u7528\u6237\u9700\u8981\u5177\u5907\u67e5\u8be2\u3001\u521b\u5efa\u3001\u4fee\u6539 DNSPod \u8bb0\u5f55\u7684\u6743\u9650\u3002<\/p>\n<h2><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/dnspod.tencentcloud.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/dnspod.tencentcloud.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" \/><\/div><code><\/code>\u5378\u8f7d\u65b9\u6cd5<\/h2>\n<p style=\"text-align: justify;\">\u5982\u679c\u9700\u8981\u56de\u9000\uff0c\u6267\u884c\uff1a<\/p>\n<pre><code>.\/uninstall.sh<\/code><\/pre>\n<p style=\"text-align: justify;\">\u5378\u8f7d\u811a\u672c\u4f1a\u4f18\u5148\u6062\u590d\u5b89\u88c5\u65f6\u751f\u6210\u7684\u5907\u4efd\u6587\u4ef6\u3002\u5982\u679c\u627e\u4e0d\u5230\u5907\u4efd\uff0c\u5219\u5c1d\u8bd5\u53cd\u5411\u5e94\u7528\u8865\u4e01\u3002<\/p>\n<h2 style=\"text-align: justify;\">\u68c0\u67e5\u9a8c\u8bc1<\/h2>\n<p style=\"text-align: justify;\">\u5b89\u88c5\u540e\u53ef\u4ee5\u6267\u884c\uff1a<\/p>\n<pre><code>\/usr\/bin\/ddns list-providers | grep -E 'cloudflare.com|alidns.aliyuncs.com|dnspod.tencentcloudapi.com'<\/code><\/pre>\n<p style=\"text-align: justify;\">\u6b63\u5e38\u60c5\u51b5\u4e0b\u5e94\u8be5\u770b\u5230\uff1a<\/p>\n<pre><code>alidns.aliyuncs.com\r\ncloudflare.com\r\ndnspod.tencentcloudapi.com<\/code><\/pre>\n<p style=\"text-align: justify;\">Cloudflare \u662f Token \u8ba4\u8bc1\u670d\u52a1\u5546\uff0c\u8fd8\u53ef\u4ee5\u68c0\u67e5\uff1a<\/p>\n<pre><code>\/usr\/bin\/ddns list-token-providers | grep cloudflare.com<\/code><code><\/code><\/pre>\n<h2 style=\"text-align: justify;\">\u95ee\u9898\u6392\u67e5<\/h2>\n<p style=\"text-align: justify;\">IPFire \u7684\u52a8\u6001 DNS \u9875\u9762\u4f1a\u7528\u989c\u8272\u663e\u793a\u4e3b\u673a\u540d\u662f\u5426\u540c\u6b65\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u7eff\u8272\uff1a\u89e3\u6790\u7ed3\u679c\u4e0e\u5f53\u524d RED IP \u4e00\u81f4<\/li>\n<li>\u7ea2\u8272\uff1a\u89e3\u6790\u7ed3\u679c\u4e0e\u5f53\u524d RED IP \u4e0d\u4e00\u81f4<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u4e2a\u5224\u65ad\u4f9d\u8d56 IPFire \u672c\u673a DNS \u89e3\u6790\u7ed3\u679c\u3002\u5982\u679c\u4f60\u521a\u521a\u5728 Cloudflare\u3001\u963f\u91cc\u4e91\u6216\u817e\u8baf\u4e91\u521b\u5efa\u4e86\u8bb0\u5f55\uff0c\u800c IPFire \u672c\u673a DNS \u4e4b\u524d\u7f13\u5b58\u8fc7 <code>NXDOMAIN<\/code>\uff0c\u9875\u9762\u53ef\u80fd\u4f1a\u6682\u65f6\u663e\u793a\u7ea2\u8272\u3002\u6b64\u65f6\u5e76\u4e0d\u4e00\u5b9a\u4ee3\u8868 DDNS \u66f4\u65b0\u5931\u8d25\u3002\u53ef\u4ee5\u7528\u516c\u5171 DNS \u9a8c\u8bc1\uff1a<\/p>\n<pre><code>dig @1.1.1.1 ipftest.example.com A\r\ndig @8.8.8.8 ipftest.example.com A<\/code><\/pre>\n<p style=\"text-align: justify;\">\u5982\u679c\u516c\u5171 DNS \u5df2\u7ecf\u8fd4\u56de\u6b63\u786e IP\uff0c\u800c IPFire \u9875\u9762\u4ecd\u663e\u793a\u7ea2\u8272\uff0c\u901a\u5e38\u53ea\u662f\u672c\u673a DNS \u7f13\u5b58\u95ee\u9898\u3002\u7b49\u5f85\u7f13\u5b58\u8fc7\u671f\uff0c\u6216\u8005\u91cd\u542f\/\u6e05\u7406\u672c\u673a DNS \u7f13\u5b58\u5373\u53ef\u3002<\/p>\n<h2 style=\"text-align: justify;\">\u8865\u4e01\u63d0\u4ea4<\/h2>\n<p style=\"text-align: justify;\">\u672c\u6b21\u4fee\u6539\u5df2\u7ecf\u6574\u7406\u4e3a\u6807\u51c6\u8865\u4e01\uff0c\u5e76\u63d0\u4ea4\u5230 IPFire \u5f00\u53d1\u90ae\u4ef6\u5217\u8868\uff0c\u5e0c\u671b\u80fd\u5728\u540e\u671f\u7248\u672c\u96c6\u6210\u3002<\/p>\n<h2>\u9644\u4ef6\u4e0b\u8f7d<\/h2>\n<p><strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/pfchina.org\/wp-content\/uploads\/2026\/06\/IPFire-dyndns.zip\">IPFire-dyndns_patch<\/a><\/span><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>IPFire \u81ea\u5e26\u52a8\u6001 DNS \u529f\u80fd\uff0c\u53ef\u4ee5\u5728\u516c\u7f51 IP \u53d8\u5316\u540e\u81ea\u52a8\u66f4\u65b0\u57df\u540d\u89e3\u6790\u8bb0\u5f55\u3002\u4e0d\u8fc7\u5728\u9ed8\u8ba4\u652f\u6301\u7684\u670d\u52a1\u5546\u5217\u8868 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[415],"tags":[490,489],"class_list":["post-16068","post","type-post","status-publish","format-standard","hentry","category-ipfire","tag-490","tag-489"],"_links":{"self":[{"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/16068","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16068"}],"version-history":[{"count":9,"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/16068\/revisions"}],"predecessor-version":[{"id":16082,"href":"https:\/\/pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/16068\/revisions\/16082"}],"wp:attachment":[{"href":"https:\/\/pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}