Home Azure DNS [Import/Export]
Post
Cancel

Azure DNS [Import/Export]

Table of Contents

Azure

Cost

As each region price varies below price is created in the Central US region, and the prices are at the time of the blog:

Product Cost Region
Resource Group Free Central US
vNet Free Central US
Subnets Free Central US
Local Network Gateway Free Central US
VPN Gateway 730 x 0.036 = $26.28 (Running)
< 5 GB = $0.00 per GB (Outbound)
> 5 GB = $0.09 per GB (Outbound)
Central US
Public IP 730 x 1 = 0.00 (Static IP)
< 5 IP = $0.00 per IP
> 5 GB = $2.63 per IP
Central US

Total: $26.28 per month for 1 Static IP and less than 5 GB of (Outbound) traffic.

Login to Azure Cli

Login into Azure Cli

Verify Azure Zone Records

Verify the zone within Azure Cli

1
az network dns record-set list -g '[myresourcegroup]' -z '[domain_name.fqdn]'

Example

1
az network dns record-set list -g 'rg-DNS-US_Central-davidmarker.com' -z 'davidmarker.com'

The output of the command will be something like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
PS C:\Users\davidmarker> az network dns record-set list -g 'rg-DNS-US_Central-davidmarker.com' -z 'davidmarker.com'
[
  {
    "aaaaRecords": null,
    "arecords": [
      {
        "ipv4Address": "185.199.108.153"
      }
    ],
    "caaRecords": null,
    "cnameRecord": null,
    "etag": "78xxxx04-6xxx-4xxd-91x4-xx3xx6x51493",
    "fqdn": "davidmarker.com.",
    "id": "/subscriptions/xxx1x7xx-9185-4xxx-xx5x-xx8x96x9xxx4/resourceGroups/rg-dns-us_central-davidmarker.com/providers/Microsoft.Network/dnszones/davidmarker.com/A/@",
    "metadata": null,
    "mxRecords": null,
    "name": "@",
    "nsRecords": null,
    "provisioningState": "Succeeded",
    "ptrRecords": null,
    "resourceGroup": "rg-dns-us_central-davidmarker.com",
    "soaRecord": null,
    "srvRecords": null,
    "targetResource": {
      "id": null
    },
    "ttl": 3600,
    "txtRecords": null,
    "type": "Microsoft.Network/dnszones/A"
  }
]

Import Zone Records into Azure DNS

Obtain your existing DNS zone file

Before you import a DNS zone file into Azure DNS, you need to obtain a copy of the zone file. The source of this file depends on where the DNS zone is currently hosted.

  • If your DNS zone is hosted by a partner service (such as a domain registrar, dedicated DNS hosting provider, or alternative cloud provider), that service should provide the ability to download the DNS zone file.
  • If your DNS zone is hosted on Windows DNS, the default folder for the zone files is %systemroot%\system32\dns. The full path to each zone file also shows on the General tab of the DNS console.
  • If your DNS zone is hosted by using BIND, the location of the zone file for each zone is specified in the BIND configuration file named.conf.

Import a zone from file

1
az network dns zone import -g '[myresourcegroup]' -n '[domain_name.fqdn]' -f '[domain_name.fqdn].txt'

Example

1
az network dns zone import -g 'rg-DNS-US_Central-davidmarker.com' -n 'davidmarker.com' -f 'davidmarker.com.txt'

The output of the command will be something like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
PS C:\Users\DMarker\OneDrive - Markers\Desktop> az network dns zone import -g 'rg-DNS-US_Central-davidmarker.com' -n 'davidmarker.com' -f 'davidmarker.com.txt'
In the future, zone name will be case insensitive.
davidmarker.com. davidmarker.com.
davidmarker.com. davidmarker.com.
davidmarker.com. davidmarker.com.
davidmarker.com. davidmarker.com.
davidmarker.com. davidmarker.com.
davidmarker.com. davidmarker.com.
davidmarker.com. davidmarker.com.
davidmarker.com. davidmarker.com.
davidmarker.com. davidmarker.com.
davidmarker.com. _sipfederationtls._tcp.davidmarker.com.
davidmarker.com. _sip._tls.davidmarker.com.
davidmarker.com. autodiscover.davidmarker.com.
davidmarker.com. enterpriseenrollment.davidmarker.com.
davidmarker.com. enterpriseregistration.davidmarker.com.
davidmarker.com. lyncdiscover.davidmarker.com.
davidmarker.com. msoid.davidmarker.com.
davidmarker.com. sip.davidmarker.com.
davidmarker.com. www.davidmarker.com.
== BEGINNING ZONE IMPORT: davidmarker.com ==

(1/18) Imported 1 records of type 'soa' and name '@'
(2/18) Imported 1 records of type 'a' and name '@'
(6/18) Imported 4 records of type 'NS' and name '@'
(7/18) Imported 1 records of type 'mx' and name '@'
(9/18) Imported 2 records of type 'txt' and name '@'
(10/18) Imported 1 records of type 'srv' and name '_sipfederationtls._tcp'
(11/18) Imported 1 records of type 'srv' and name '_sip._tls'
(12/18) Imported 1 records of type 'cname' and name 'autodiscover'
(13/18) Imported 1 records of type 'cname' and name 'enterpriseenrollment'
(14/18) Imported 1 records of type 'cname' and name 'enterpriseregistration'
(15/18) Imported 1 records of type 'cname' and name 'lyncdiscover'
(16/18) Imported 1 records of type 'cname' and name 'msoid'
(17/18) Imported 1 records of type 'cname' and name 'sip'
(18/18) Imported 1 records of type 'cname' and name 'www'

== 18/18 RECORDS IMPORTED SUCCESSFULLY: 'davidmarker.com' ==

Export Zone Records

Export a zone to file

1
az network dns zone export -g '[myresourcegroup]' -n '[domain_name.fqdn]' -f '[domain_name.fqdn].txt'

Example

1
az network dns zone export -g 'rg-DNS-US_Central-davidmarker.com' -n 'davidmarker.com' -f 'davidmarker.com.txt'

The output of the command will be something like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
PS C:\Users\davidmarker> az network dns zone export -g 'rg-DNS-US_Central-davidmarker.com' -n 'davidmarker.com' -f 'davidmarker.com.txt'

; Exported zone file from Azure DNS
;      Zone name: davidmarker.com
;      Resource Group Name: rg-DNS-US_Central-davidmarker.com
;      Date and time (UTC): Sat, 18 Apr 2020 20:38:16 -0400

$TTL 3600
$ORIGIN davidmarker.com.

@ 3600 IN SOA ns1-06.azure-dns.com. dns-admin.davidmarker.com. (
              2020022901 ; serial
              3600 ; refresh
              300 ; retry
              2419200 ; expire
              3600 ; minimum
              )

  3600 IN A 185.199.108.153

  172800 IN NS ns1-01.azure-dns.com.
  172800 IN NS ns2-01.azure-dns.net.
  172800 IN NS ns3-01.azure-dns.org.
  172800 IN NS ns4-01.azure-dns.info.

  3600 IN MX 10 davidmarker-com.mail.protection.outlook.com
  3600 IN TXT "v=spf1 include:spf.protection.outlook.com -all"

_sipfederationtls._tcp 3600 IN SRV 100 1 5061 sipfed.online.lync.com
_sip._tls 3600 IN SRV 100 1 443 sipdir.online.lync.com

autodiscover 3600 IN CNAME autodiscover.outlook.com.
enterpriseenrollment 3600 IN CNAME enterpriseenrollment.manage.microsoft.com.
enterpriseregistration 3600 IN CNAME enterpriseregistration.windows.net.
lyncdiscover 3600 IN CNAME webdir.online.lync.com.
msoid 3600 IN CNAME clientconfig.microsoftonline-p.net.
sip 3600 IN CNAME sipdir.online.lync.com.
www 3600 IN A 185.199.108.153
https://docs.microsoft.com/en-us/azure/dns/dns-import-export
This post is licensed under CC BY-SA 4.0 by David Marker