truems
V2EX  ›  DNS

在 route53 添加自己的域名服务器

  •  
  •   truems · Aug 1, 2019 · 6476 views
    This topic created in 2504 days ago, the information mentioned may be changed or developed.

    我在一台 EC2 实例上跑了 CoreDNS 服务作为私有域名服务器,实例绑定了公网 IP。使用 dig 直接向这个实例发出 dns 请求无问题。后尝试在 Route53 里一个托管区域下添加一条 NS 记录,域名是托管域的子域。用 dig 向公共域名服务器,如 8.8.8.8,查询 NS 记录,可以得到 answer。不过查询 A 记录得到的状态是 SERVFAIL,那台 EC2 实例上好像也没有 DNS 的流量。求各位大佬支招!跪谢!

    6 replies    2019-08-01 12:14:47 +08:00
    mytsing520
        1
    mytsing520  
    PRO
       Aug 1, 2019
    请带上实际域名,或相关截图
    shiji
        2
    shiji  
       Aug 1, 2019 via iPhone
    目测是需要设置 glue record 的 因为 ns 是托管域的子域
    truems
        4
    truems  
    OP
       Aug 1, 2019
    @mytsing520 谢谢回复。举个🌰就是,route53 有个托管域,example.com. 我在里面加一个 NS 记录,“ test.example.com. NS 192.168.1.1 ”, 假设 192.168.1.1 是 EC2 实例的公网 ip,EC2 实例允许 53 端口 TCP/UDP 访问。然后尝试 dig A www.test.example.com, 会 SERVFAIL. 如果 dig @192.168.1.1 A www.test.example.com, 可以得到 CoreDNS 服务里配置的 ip。
    truems
        5
    truems  
    OP
       Aug 1, 2019
    @shiji 非常感谢。在 Route53 里添加了如下记录,“ test . example . com. NS ns . test . example . com ” 和 “ ns . test . example . com A 192.168.1.1 ”。dig 可以成功了。准备部署完整的服务进行测试。再次谢谢大家的帮助。
    Had
        6
    Had  
       Aug 1, 2019
    为什么不创建私有托管区域绑定 VPC 呢?
    楼主想实现什么功能呀?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   972 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 19:26 · PVG 03:26 · LAX 12:26 · JFK 15:26
    ♥ Do have faith in what you're doing.