powerdns 常见维护备忘

简介:  1. vcapple.com  dev.vpapple.com  qa.vpapple.com  10.199 反向解析  上述 DNS 数据修改时候, 只能够修改 master ( 10.199.132.152 ) 2. 当上述域名数据修改后,  数据会自动同步至 10.199.132.168 (slave) 与 10.199.129.21 (slave) 3. 10.199


1. vcapple.com  dev.vpapple.com  qa.vpapple.com  10.199 反向解析  上述 DNS 数据修改时候, 只能够修改 master ( 10.199.132.152 )

2. 当上述域名数据修改后,  数据会自动同步至 10.199.132.168 (slave) 与 10.199.129.21 (slave)

3. 10.199.132.152 (pdns, master ) 10.199.132.168 (pdns, slave) 与 10.199.129.21 (bind, slave)

4. 10.199.132.152 (pdns, master ) 10.199.132.168 (pdns, slave) 需利用 mysql AB 复制实现数据同步

5. 域名解析在数据库中需要有 NS 记录与 A记录与 SOA 记录


5.1  SOA 为唯一记录

mysql> select domain_id, name, type, content from records where type='SOA';
+-----------+---------------------+------+----------------------------------------------------------------------------+
| domain_id | name                | type | content                                                                    |
+-----------+---------------------+------+----------------------------------------------------------------------------+
|         1 | vcapple.com         | SOA  | dns.vcapple.com dns.vcapple.com 201401104 28800 7200 604800 86400          |
|         2 | 199.10.in-addr.arpa | SOA  | dns.vcapple.com dns.vcapple.com 201401104 28800 7200 604800 86400          |
|         5 | qa.vpapple.com      | SOA  | dns.qa.vpapple.com dns.qa.vpapple.com 2014013002 28800 7200 604800 86400   |
|         6 | dev.vpapple.com     | SOA  | dns.dev.vpapple.com dns.dev.vpapple.com 2014013002 28800 7200 604800 86400 |
+-----------+---------------------+------+----------------------------------------------------------------------------+
4 rows in set (0.00 sec)


5.2  NS 记录必须包含所有 DNS 服务器记录

mysql> select domain_id, name,type, content from records where type='NS' and name='vcapple.com';
+-----------+-------------+------+----------------------------------+
| domain_id | name        | type | content                          |
+-----------+-------------+------+----------------------------------+
|         1 | vcapple.com | NS   | dns.vcapple.com                  |
|         1 | vcapple.com | NS   | dns-slave.vcapple.com            |
|         1 | vcapple.com | NS   | hh-yun-puppet-129021.vcapple.com |
+-----------+-------------+------+----------------------------------+
3 rows in set (0.00 sec)

mysql> select domain_id, name, type, content from recordswhere type='NS' and name='199.10.in-addr.arpa';
+-----------+---------------------+------+----------------------------------+
| domain_id | name                | type | content                          |
+-----------+---------------------+------+----------------------------------+
|         2 | 199.10.in-addr.arpa | NS   | dns.vcapple.com                  |
|         2 | 199.10.in-addr.arpa | NS   | dns-slave.vcapple.com            |
|         2 | 199.10.in-addr.arpa | NS   | hh-yun-puppet-129021.vcapple.com |
+-----------+---------------------+------+----------------------------------+
3 rows in set (0.00 sec)


5.3 域名中需要填写对应的 DNS 服务器记录

mysql> select domain_id, name, type, content, ttl from records where type='A' and name='vcapple.com';
+-----------+-------------+------+----------------+------+
| domain_id | name        | type | content        | ttl  |
+-----------+-------------+------+----------------+------+
|         1 | vcapple.com | A    | 10.199.132.152 |  360 |
|         1 | vcapple.com | A    | 10.199.132.168 |  360 |
|         1 | vcapple.com | A    | 10.199.129.21  |  360 |
+-----------+-------------+------+----------------+------+
3 rows in set (0.00 sec)

5.4 必须具备上述主机的 A 记录, 建议具备PTR 记录

mysql> select id, domain_id, name, type, content, ttl from records where type='A' and name in ( 'dns.vcapple.com', 'dns-slave.vcapple.com', 'hh-yun-puppet-129021.vcapple.com');
+------+-----------+----------------------------------+------+----------------+------+
| id   | domain_id | name                             | type | content        | ttl  |
+------+-----------+----------------------------------+------+----------------+------+
| 5407 |         1 | dns-slave.vcapple.com            | A    | 10.199.132.168 | 3306 |
| 3965 |         1 | dns.vcapple.com                  | A    | 10.199.132.152 |  360 |
| 3672 |         1 | hh-yun-puppet-129021.vcapple.com | A    | 10.199.129.21  |  360 |
+------+-----------+----------------------------------+------+----------------+------+
3 rows in set (0.00 sec)

5.5 子域需重新授权

mysql> select id, domain_id, name, type, content, ttl from records where domain_id=1 and type='NS';
+------+-----------+-----------------+------+----------------------------------+------+
| id   | domain_id | name            | type | content                          | ttl  |
+------+-----------+-----------------+------+----------------------------------+------+
| 3962 |         1 | vcapple.com     | NS   | dns.vcapple.com                  | 360  |
| 5404 |         1 | vcapple.com     | NS   | dns-slave.vcapple.com            | 3306 |
| 5418 |         1 | vcapple.com     | NS   | hh-yun-puppet-129021.vcapple.com |  360 |
| 5441 |         1 | dev.vcapple.com | NS   | dns.dev.vcapple.com              |  360 |  <- 子域授权
+------+-----------+-----------------+------+----------------------------------+------+
4 rows in set (0.00 sec)


6. 经检验 PDNS 新版本才支持通知 bind 进行自动更新 dns 数据功能

[root@pdns-8tedp ~]# rpm -qa | grep pdns
pdns-static-3.4.1-1.x86_64


配置简要说明

[root@pdns-8tedp ~]# cat /etc/powerdns/pdns.conf | grep -v "#" | grep -v ^$

allow-axfr-ips=10.199.196.233,10.199.129.21
allow-recursion=10.199.196.233,10.199.129.21
also-notify=10.199.196.233,10.199.129.21    <-- 旧版本不支持该功能, 该功能能够主动通知从服务器进行数据更新
daemon=yes
launch=gmysql
gmysql-host=127.0.0.1
gmysql-port=3306
gmysql-user=pdns
gmysql-dbname=pdns
gmysql-password=vipshop
guardian=yes
master=yes
recursor=10.199.129.21


参考测试数据库

mysql> select * from domains;
+----+-----------+--------+------------+--------+-----------------+---------+
| id | name      | master | last_check | type   | notified_serial | account |
+----+-----------+--------+------------+--------+-----------------+---------+
|  1 | terry.com | NULL   |       NULL | MASTER |               4 | NULL    |
+----+-----------+--------+------------+--------+-----------------+---------+
1 row in set (0.00 sec)


mysql> select * from records;
+----+-----------+-----------------+------+--------------------------------------------------------+------+------+-------------+----------+-----------+------+
| id | domain_id | name            | type | content                                                | ttl  | prio | change_date | disabled | ordername | auth |
+----+-----------+-----------------+------+--------------------------------------------------------+------+------+-------------+----------+-----------+------+
|  1 |         1 | terry.com       | NS   | dns.terry.com                                          | 3360 | NULL |        NULL |        0 | NULL      |    1 |
|  3 |         1 | dns.terry.com   | A    | 10.199.197.19                                          | 3360 | NULL |        NULL |        0 | NULL      |    1 |
|  4 |         1 | terry.com       | NS   | slave.terry.com                                        | 3360 | NULL |        NULL |        0 | NULL      |    1 |
|  5 |         1 | slave.terry.com | A    | 10.199.196.233                                         | 3360 | NULL |        NULL |        0 | NULL      |    1 |
|  6 |         1 | ttt.terry.com   | A    | 5.5.5.5                                                | 3360 | NULL |        NULL |        0 | NULL      |    1 |
|  7 |         1 | terry.com       | SOA  | dns.terry.com admin.terry.com 4 10800 3600 604800 3600 | 3360 |    0 |        NULL |        0 | NULL      |    1 |
+----+-----------+-----------------+------+--------------------------------------------------------+------+------+-------------+----------+-----------+------+
6 rows in set (0.00 sec)


每次执行DNS 更新, 都需要执行 soa 更新


soa 值来源于上面 domains 表中  notified_serial  列中的值 (select notified_serial from domains where name='terry.com';)


更新 SOA 方法如下, 替换下面关键字 新的 SOA_NUM, 常见新的 SOA 为上一次的数字 +1 的操作

select notified_serial +1 from domains where name='terry.com'
update records set content='dns.terry.com admin.terry.com 新的SOA_NUM 10800 3600 604800 3600' where name='terry.com' and type='SOA';



目录
相关文章
|
9天前
|
人工智能 JSON 安全
Fastjson远程代码执行漏洞,阿里云AI安全为您保驾护航
阿里云AI安全产品联动防御Fastjson攻击
2331 12
Fastjson远程代码执行漏洞,阿里云AI安全为您保驾护航
|
9天前
|
云安全 人工智能 安全
|
9天前
|
人工智能 自然语言处理 数据挖掘
Qwen3.8-Max-Preview深度全解析:2.4万亿参数旗舰MoE模型+Token Plan限时优惠完整落地指南
2026年7月,全新旗舰级混合专家大模型Qwen3.8-Max-Preview正式开放抢先体验,作为通义千问Qwen3系列规格最高、综合推理能力顶尖的新一代模型,该模型总参数量达到2.4万亿(2.4T),是当前线上可调用的原生多模态旗舰模型,综合推理水准对标海外顶级Fable 5模型,在复杂工程开发、长文档深度分析、多步骤智能体自治、跨境多语言创作、海量数据挖掘五大高难度业务场景实现跨越式性能提升。
1049 2
|
9天前
|
人工智能 自然语言处理 数据挖掘
最新版通义千问(Qwen3.8-Max-Preview)功能介绍
2026年,通义千问正式推出全新旗舰级大模型 **Qwen3.8-Max-Preview 预览版**,作为首款突破万亿参数规格的新一代基座模型,该模型总参数量达到**2.4万亿**,采用全新迭代的MoE混合专家架构,综合推理性能、长文本处理、多模态理解、复杂任务规划能力全面超越前代Qwen3.7-Max版本,整体实力跻身全球第一梯队,可对标海外顶级旗舰模型,是当前面向复杂工程开发、多智能体协同、超长文档解析、专业办公自动化场景的最优国产基座模型。
1087 0
|
11天前
|
人工智能
Qwen3.8抢先体验!正式版即将发布并开源!
千问Qwen3.8即将开源,参数达2.4T,进化速度以“天”计,实力媲美Fable 5。预览版Qwen3.8-Max已上线阿里Token Plan等平台,限时优惠:日间Credits低至1折,夜间更优,个人/团队版月付仅35元起!
1048 44
|
7天前
|
自然语言处理 测试技术 API
通义千问Qwen3.8-Max-Preview全功能解析:2.4万亿参数旗舰模型深度使用指南
在大模型技术持续迭代的当下,通义千问推出的Qwen3.8-Max-Preview作为新一代旗舰预览版模型,凭借2.4万亿参数的超大规模、多模态融合能力与全场景适配特性,成为开发者与企业用户探索AI应用的核心工具。该模型采用稀疏混合专家(MoE)架构,是通义千问首个突破万亿参数的多模态模型,可同时处理文本、图像、视频与文档等多种数据形态,在全栈代码开发、复杂逻辑推理、长文档分析与多智能体协作等场景实现跨越式升级。本文将全面拆解Qwen3.8-Max-Preview的核心功能,详解API调用流程与配置方法,覆盖多场景实战技巧,帮助用户快速掌握这款旗舰模型的使用方法,充分释放其性能潜力。
521 1
|
7天前
|
人工智能 前端开发 Linux
Codex 桌面版安装 + CC Switch 接入第三方 API 完整教程(2026 最新)
2026最新教程:手把手教你安装Codex桌面版,通过CC Switch v3.17.0一键接入Fenno等国产API(兼容OpenAI Responses格式),跳过账号登录,完整启用代码审查、多步任务与上下文感知功能。零基础友好,全程图文实操。(239字)
621 0
|
10天前
|
人工智能 自然语言处理 数据挖掘
Qwen3.8-Max 预览版全解析:2.4 万亿参数旗舰模型,Token Plan 限时优惠指南
Qwen3.8-Max-Preview是通义千问Qwen3系列旗舰MoE大模型,参数达2.4万亿,综合推理能力居行业第一梯队。支持思考/快速双模式,擅长大模型五大高难场景。现于阿里云百炼Token Plan、Qoder及QoderWork上线体验,个人版低至39元/月。在阿里云百炼官网:https://t.aliyun.com/U/fPVHqY 免费领取千万Tokens
714 1
Qwen3.8-Max 预览版全解析:2.4 万亿参数旗舰模型,Token Plan 限时优惠指南