9.2. 使用 nsupdate 更新外部 DNS 记录


生成 DNS 记录文件,以用于 nsupdate 工具,以便在 IdM 部署中拓扑更改后更新外部 DNS 记录。您还可以将命令添加到脚本中来自动化过程。

步骤

  • 要使用 nsupdate 的 DNS 记录生成文件,请使用带有-- out 选项的 'ipa dns-update-system-records -- dry-run 命令。--out 选项指定要生成的文件的路径:

    $ ipa dns-update-system-records --dry-run --out dns_records_file.nsupdate
     IPA DNS records:
       _kerberos-master._tcp.example.com. 86400 IN SRV 0 100 88 ipa.example.com.
       _kerberos-master._udp.example.com. 86400 IN SRV 0 100 88 ipa.example.com.
    [... output truncated ...]

    生成的文件包含所需的、nsupdate 工具接受的格式的 DNS 记录。

    例如:

    $ cat dns_records_file.nsupdate
    zone example.com.
    server 192.0.2.1
    ; IPA DNS records
    update delete _kerberos-master._tcp.example.com. SRV
    update add _kerberos-master._tcp.example.com. 86400 IN SRV 0 100 88 ipa.example.com.
    [... output truncated ...]

    生成的记录依赖于:

    • 其中记录要被更新的区域的自动检测。
    • 区域的权威服务器的自动检测。

      如果您使用一个非典型的 DNS 设置,或者如果缺少区域委派,则 nsupdate 可能无法找到正确的区域和服务器。在这种情况下,在生成的文件的开头添加以下选项:

    • server :指定 nsupdate 向其发送记录的服务器名称或权威 DNS 服务器的端口。
    • zone :指定 nsupdate 放置记录的区域的名称。
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部