Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS zone import command has different behavior depending on the CLI version being used. #29375

Open
WhiteHorseV opened this issue Jul 12, 2024 · 3 comments
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Network - DNS az network dns Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue

Comments

@WhiteHorseV
Copy link

Describe the bug

Hi Team,
We have a Azure DNS customer who is complaining that azcli feature has diverged between azcli versions 2.36.0, 2.60.0 and 2.61.0.
What is the observed result vs what is the expected? What is the specific deviation?
az network dns zone import -g -n -f

has different behavior depending on the CLI version being used.

Latest Az version 2.61.0 will provide error IF NS records are present in the file:

image

While older versions (2.36.0) would ignore the NS records and complete the import:

image

Our understand was that NS records will be ignored:

The name server record set at the zone apex is also created automatically by Azure DNS when the zone is created. Only the TTL of this record set is imported. These records contain the name server names provided by Azure DNS. The record data isn't overwritten by the values contained in the imported zone file.

Related command

az network dns zone import -g <resource group> -n <zone name> -f <zone file name>

Errors

image

Issue script & Debug output

The error customer sees is getting thrown by this -

print("({}/{}) Imported {} records of type '{}' and name '{}'"

Expected behavior

With Az version 2.36.0, there is no issue with both zone file above we think it is right and wrong.
With Az version 2.60.0 and 2.61.0, we have issue with both zone file above and it always start with NS record. After remove NS, it's working.

Customers want to use the command below to import the DNS zone below.

Command: az network dns zone import -g -n -f

Zone file:

;c2.net.pl

c2.net.pl.        86400 IN    SOA   ns0.dnsmadeeasy.com. dns.dnsmadeeasy.com. 2008010120 43200 3600 1209600 180
c2.net.pl.        600   IN    TXT   "v=spf1 -all"
c2.net.pl.        600   IN    TXT   "MS=ms24745685"
c2.net.pl.        86400 IN    NS    ns0.dnsmadeeasy.com.
c2.net.pl.        86400 IN    NS    ns1.dnsmadeeasy.com.
c2.net.pl.        86400 IN    NS    ns2.dnsmadeeasy.com.
c2.net.pl.        86400 IN    NS    ns3.dnsmadeeasy.com.
c2.net.pl.        86400 IN    NS    ns4.dnsmadeeasy.com.
autodiscover.c2.net.pl. 3600  IN    CNAME autodiscover.outlook.com.

=========================================================================

After discussed with TA, we think the right zone file should looks like below and this zone successfully import from Azure Portal.

;c2.net.pl

@ 86400 IN SOA ns0.dnsmadeeasy.com. dns.dnsmadeeasy.com. 2008010120 43200 3600 1209600 180

@ 600 IN TXT "v=spf1 -all"

@ 600 IN TXT "MS=ms24745685"

@ 86400 IN NS ns0.dnsmadeeasy.com.

@ 86400 IN NS ns1.dnsmadeeasy.com.

@ 86400 IN NS ns2.dnsmadeeasy.com.

@ 86400 IN NS ns3.dnsmadeeasy.com.

@ 86400 IN NS ns4.dnsmadeeasy.com.

autodiscover 3600 IN CNAME autodiscover.outlook.com.

Environment Summary

2.36.0
vs
2.60.0
vs
2.61.0

Additional context

No response

@WhiteHorseV WhiteHorseV added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 12, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jul 12, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 12, 2024

Thank you for opening this issue, we will look into it.

Copy link

Hi @WhiteHorseV
Find similar issue #1126.

Issue title [DNS] 'az network dns zone import' doesn't work
Create time 2016-10-24
Comment number 2

Possible solution:
The issue reported in #1126 is about the 'az network dns zone import' command not working and throwing errors. The solution provided in the comments of that issue is that the current implementation cannot handle multiple TXT entries per record. The issue reported in this new ticket is about the 'az network dns zone import' command having different behavior depending on the CLI version being used. The solution provided in the old issue might not directly solve the problem in the new issue, but it is worth noting that the import command is designed to consume the DNS zone file in the format that the export command outputs, and that the command will be overhauled in tandem.


Please confirm if this resolves your issue.

@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Service Attention This issue is responsible by Azure service team. labels Jul 12, 2024
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dnssuppgithub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Network - DNS az network dns Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue
Projects
None yet
Development

No branches or pull requests

2 participants