【问题标题】:Add DNS entry to CoreDNS using nsupdate使用 nsupdate 将 DNS 条目添加到 CoreDNS
【发布时间】:2020-02-07 10:51:01
【问题描述】:

我正在尝试设置/使用CoreDNS 进行测试。

问题:如何使用 nsupdate 将 DNS 条目添加到 CoreDNS

到目前为止,我可以执行以下步骤

  1. 使用Docker CoreDNS 运行CoreDNS 容器。

  2. 使用 dig 命令验证 ANSWER SECTION - Working

    挖掘@localhost -p 2053 gateway.example.com

    ; <<>> DiG 9.11.5-P1-1ubuntu2.6-Ubuntu <<>> @localhost -p 2053 gateway.example.com
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43649
    ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1
    ;; WARNING: recursion requested but not available
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ; COOKIE: b3198c49725db20b (echoed)
    ;; QUESTION SECTION:
    ;gateway.example.com.           IN      A
    
    ;; ANSWER SECTION:
    gateway.example.com.    3600    IN      A       192.168.1.1
    
    ;; AUTHORITY SECTION:
    example.com.            3600    IN      NS      a.iana-servers.net.
    example.com.            3600    IN      NS      b.iana-servers.net.
    
    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.1#2053(127.0.0.1)
    ;; WHEN: Fri Feb 07 21:20:03 AEDT 2020
    ;; MSG SIZE  rcvd: 181
    
  3. 尝试使用 nsupdate

    添加条目
    nsupdate -d
    > server localhost 2053
    > update add gateway1.example.com 86400 A 172.16.1.2
    > send
    Reply from SOA query:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:   1844
    ;; flags: qr aa; QUESTION: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0
    ;; QUESTION SECTION:
    ;gateway1.example.com.          IN      SOA
    
    ;; ANSWER SECTION:
    example.com.            3600    IN      SOA     sns.dns.icann.org. noc.dns.icann.org. 2018070500 7200 3600 1209600 3600
    
    ;; AUTHORITY SECTION:
    example.com.            3600    IN      NS      a.iana-servers.net.
    example.com.            3600    IN      NS      b.iana-servers.net.
    
    Found zone name: example.com
    The master is: sns.dns.icann.org
    Sending update to 127.0.0.1#2053
    Outgoing update query:
    ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:  37199
    ;; flags:; ZONE: 1, PREREQ: 0, UPDATE: 1, ADDITIONAL: 0
    ;; UPDATE SECTION:
    gateway1.example.com.   86400   IN      A       172.16.1.2
    
    
    Reply from update query:
    ;; ->>HEADER<<- opcode: UPDATE, status: NOTIMP, id:  37199
    ;; flags: qr; ZONE: 0, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
    
  4. 使用 dig 命令验证添加的 DNS 条目 - 不工作

    挖掘@localhost -p 2053 gateway1.example.com

    ; <<>> DiG 9.11.5-P1-1ubuntu2.6-Ubuntu <<>> @localhost -p 2053 gateway1.example.com
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 44362
    ;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
    ;; WARNING: recursion requested but not available
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ; COOKIE: 65143756198117f0 (echoed)
    ;; QUESTION SECTION:
    ;gateway1.example.com.          IN      A
    
    ;; AUTHORITY SECTION:
    example.com.            3600    IN      SOA     sns.dns.icann.org. noc.dns.icann.org. 2018070500 7200 3600 1209600 3600
    
    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.1#2053(127.0.0.1)
    ;; WHEN: Fri Feb 07 21:24:25 AEDT 2020
    ;; MSG SIZE  rcvd: 142
    

第四步不返回ANSWER SECTION。我认为它没有被添加。

我是否必须在其 Corefile 中添加不同的 CoreDNS 插件?

任何提示/解决方案都会帮助我前进!!

谢谢

【问题讨论】:

    标签: coredns


    【解决方案1】:

    我认为 coredns 不支持更新区域中的记录。

    ;; ->>HEADER

    我最近一直在研究 coredns,看看是否可以在本地 BIND 区域和 GCP Clouddns 之间充当 shim。不幸的是,目前它似乎不支持这个用例。

    【讨论】:

      猜你喜欢
      • 2021-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-16
      • 2013-09-24
      • 1970-01-01
      • 2020-09-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多