StackExchange / dnscontrol

Infrastructure as code for DNS!
https://dnscontrol.org/
MIT License
3.16k stars 400 forks source link

AWS Route53 Private Hosted Zone. NameServers being deleted #3180

Open alexandrenakagawa opened 3 weeks ago

alexandrenakagawa commented 3 weeks ago

NOTE: Have a general question? You'll get a better response on the dnscontrol-discuss email list!

Describe the bug If you create a private hosted zone on aws Route53, and try to use with dnscontrol, the NameServers associated with the zone are deleted when do a preview or push

To Reproduce Steps to reproduce the behavior:

  1. Create a private hosted zone on route53.
  2. create a simple dnsconfig.js with var REG_NONE = NewRegistrar("none"); var DSP_R53 = NewDnsProvider("r53_main"); D("domain.local", REG_NONE, DnsProvider(DSP_R53), A("teste", "2.2.2.2"), A("teste2", "2.2.2.2") );
  3. Do a preview or push.
  4. CONCURRENTLY gathering 1 zone(s) SERIALLY gathering 0 zone(s) Waiting for concurrent gathering(s) to complete...DONE **** Domain: domain.local 4 corrections (r53_main)
    • DELETE domain.local NS ns-0.awsdns-00.com. ttl=300
    • DELETE domain.local NS ns-1024.awsdns-00.org. ttl=300
    • DELETE domain.local NS ns-1536.awsdns-00.co.uk. ttl=300
    • DELETE domain.local NS ns-512.awsdns-00.net. ttl=300 INFO#1: No nameservers declared for domain "domain.local"; skipping registrar. Add {no_ns:'true'} to force Done. 4 corrections.

Expected behavior Expected behavior is a no change in NS. DNSControl reads the NameServers from zone and normalize Works if the zone is a Public Hosted Zone

DNS Provider

Additional context Error occur only with private zone used DnsProvider(DSP_R53, 4), or DnsProvider(DSP_R53), in config and got same error. tried to declare R53_ZONE("XXXXXXXX") and got error too.

Discussed in https://groups.google.com/g/dnscontrol-discuss/c/jqxz0xvv6-w

.\dnscontrol.exe version DNSControl version 4.14.0 Windows AMD64 binaries.

running on windows server 2022 (21H2)

cafferata commented 3 weeks ago

cc: @tresni