Bird
Raised Fist0
Azurecloud~10 mins

Azure DNS basics - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a DNS zone in Azure CLI.

Azure
az network dns zone create --resource-group myResourceGroup --name [1]
Drag options to blanks, or click blank then click option'
AmyResourceGroup
Bexample.com
CdnsZone
DzoneName
Attempts:
3 left
💡 Hint
Common Mistakes
Using the resource group name instead of the DNS zone name.
Using a generic label instead of a domain name.
2fill in blank
medium

Complete the code to add an A record to the DNS zone using Azure CLI.

Azure
az network dns record-set a add-record --resource-group myResourceGroup --zone-name example.com --record-set-name www --ipv4-address [1]
Drag options to blanks, or click blank then click option'
AmyResourceGroup
Bwww
Cexample.com
D192.168.1.1
Attempts:
3 left
💡 Hint
Common Mistakes
Using the resource group or zone name instead of an IP address.
Using a domain name instead of an IP address.
3fill in blank
hard

Fix the error in the Azure CLI command to delete a DNS zone.

Azure
az network dns zone [1] --resource-group myResourceGroup --name example.com
Drag options to blanks, or click blank then click option'
Adelete
Bremove
Cdestroy
Ddrop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove' or 'destroy' instead of 'delete'.
Using 'drop' which is not a valid Azure CLI command.
4fill in blank
hard

Fill both blanks to create a CNAME record pointing www to contoso.com.

Azure
az network dns record-set cname create --resource-group myResourceGroup --zone-name example.com --record-set-name [1] && az network dns record-set cname set-record --resource-group myResourceGroup --zone-name example.com --record-set-name www --cname [2]
Drag options to blanks, or click blank then click option'
Awww
Bcontoso.com
Cexample.com
DmyResourceGroup
Attempts:
3 left
💡 Hint
Common Mistakes
Using the zone name or resource group name instead of 'www' for the record set name.
Using the zone name instead of the target domain for the CNAME.
5fill in blank
hard

Fill all three blanks to list all DNS zones in a resource group and filter by name containing 'prod'.

Azure
az network dns zone list --resource-group [1] --query "[?contains(name, '[2]')]" --output [3]
Drag options to blanks, or click blank then click option'
AmyResourceGroup
Bprod
Ctable
Dexample.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using the zone name instead of the resource group name.
Using an incorrect output format like 'jsonc' or 'yaml'.

Practice

(1/5)
1. What is the main purpose of Azure DNS?
easy
A. To monitor network traffic in real-time
B. To store files and documents securely
C. To run virtual machines in the cloud
D. To manage domain names and translate them to IP addresses

Solution

  1. Step 1: Understand Azure DNS role

    Azure DNS is used to manage domain names and their records inside Azure.
  2. Step 2: Identify main function

    It translates domain names into IP addresses so users can find services on the internet.
  3. Final Answer:

    To manage domain names and translate them to IP addresses -> Option D
  4. Quick Check:

    Azure DNS = Domain name management [OK]
Hint: Azure DNS handles domain names, not files or VMs [OK]
Common Mistakes:
  • Confusing DNS with storage services
  • Thinking Azure DNS runs virtual machines
  • Mixing DNS with network monitoring
2. Which of the following is the correct way to create a DNS zone in Azure CLI?
easy
A. az network dns zone create -g MyResourceGroup -n example.com
B. az dns create zone -g MyResourceGroup -n example.com
C. az network create dnszone -g MyResourceGroup -n example.com
D. az dns zone new -g MyResourceGroup -n example.com

Solution

  1. Step 1: Recall Azure CLI syntax for DNS zone creation

    The correct command uses 'az network dns zone create' with resource group and zone name.
  2. Step 2: Compare options

    Only az network dns zone create -g MyResourceGroup -n example.com matches the correct Azure CLI syntax for creating a DNS zone.
  3. Final Answer:

    az network dns zone create -g MyResourceGroup -n example.com -> Option A
  4. Quick Check:

    Correct Azure CLI DNS zone command = az network dns zone create -g MyResourceGroup -n example.com [OK]
Hint: Remember 'az network dns zone create' for DNS zones [OK]
Common Mistakes:
  • Using incorrect command verbs like 'new' or 'create zone'
  • Omitting 'network' in the command
  • Mixing up command order or parameters
3. Given this Azure CLI command:
az network dns record-set a add-record -g MyRG -z example.com -n www -a 10.0.0.1
What does this command do?
medium
A. Creates a DNS zone named 'www' in resource group MyRG
B. Creates an A record named 'www' pointing to IP 10.0.0.1 in example.com zone
C. Deletes the A record named 'www' in example.com zone
D. Adds a CNAME record pointing 'www' to 10.0.0.1

Solution

  1. Step 1: Analyze command components

    The command adds an A record ('-a') named 'www' with IP 10.0.0.1 to the DNS zone 'example.com' in resource group 'MyRG'.
  2. Step 2: Confirm record type and action

    'add-record' means creating a record, and 'a' specifies an A record (IP address).
  3. Final Answer:

    Creates an A record named 'www' pointing to IP 10.0.0.1 in example.com zone -> Option B
  4. Quick Check:

    Command adds A record 'www' with IP 10.0.0.1 [OK]
Hint: A record = IP address, add-record means create [OK]
Common Mistakes:
  • Confusing A record with CNAME
  • Thinking the command deletes records
  • Misreading '-n' as zone name instead of record name
4. You run this command to add a TXT record:
az network dns record-set txt add-record -g RG1 -z example.com -n info -v "verification=12345"
But it fails with an error. What is the likely cause?
medium
A. The '-v' parameter is invalid; it should be '-a' for TXT records
B. The record name '-n' cannot be 'info' for TXT records
C. The TXT record value must be enclosed in single quotes, not double quotes
D. The resource group name 'RG1' is missing

Solution

  1. Step 1: Check TXT record syntax

    TXT record values often require single quotes to avoid shell parsing errors.
  2. Step 2: Identify error cause

    Using double quotes can cause the shell to misinterpret the value, leading to failure.
  3. Final Answer:

    The TXT record value must be enclosed in single quotes, not double quotes -> Option C
  4. Quick Check:

    Use single quotes for TXT values to avoid errors [OK]
Hint: Use single quotes for TXT record values in CLI [OK]
Common Mistakes:
  • Using wrong parameter '-a' instead of '-v' for TXT
  • Assuming record name restrictions incorrectly
  • Ignoring resource group existence
5. You want to create a DNS zone for your domain 'myapp.com' and add two records: an A record for 'app' pointing to 192.168.1.10 and a CNAME record for 'www' pointing to 'app.myapp.com'. Which sequence of Azure CLI commands correctly achieves this?
hard
A. 1) az network dns zone create -g RG -n myapp.com
2) az network dns record-set a add-record -g RG -z myapp.com -n app -a 192.168.1.10
3) az network dns record-set cname set-record -g RG -z myapp.com -n www -c app.myapp.com
B. 1) az network dns zone create -g RG -n myapp.com
2) az network dns record-set cname add-record -g RG -z myapp.com -n app -c 192.168.1.10
3) az network dns record-set a set-record -g RG -z myapp.com -n www -a app.myapp.com
C. 1) az dns zone create -g RG -n myapp.com
2) az network dns record-set a add-record -g RG -z myapp.com -n app -a 192.168.1.10
3) az network dns record-set cname add-record -g RG -z myapp.com -n www -c app.myapp.com
D. 1) az network dns zone create -g RG -n myapp.com
2) az network dns record-set a add-record -g RG -z myapp.com -n app -a 192.168.1.10
3) az network dns record-set cname add-record -g RG -z myapp.com -n www -a app.myapp.com

Solution

  1. Step 1: Create DNS zone

    Use 'az network dns zone create' with resource group and domain name to create the zone.
  2. Step 2: Add A record for 'app'

    Use 'az network dns record-set a add-record' with correct parameters to add IP address record.
  3. Step 3: Add CNAME record for 'www'

    Use 'az network dns record-set cname set-record' to point 'www' to 'app.myapp.com'.
  4. Final Answer:

    1) az network dns zone create -g RG -n myapp.com
    2) az network dns record-set a add-record -g RG -z myapp.com -n app -a 192.168.1.10
    3) az network dns record-set cname set-record -g RG -z myapp.com -n www -c app.myapp.com
    -> Option A
  5. Quick Check:

    Zone create + A record + CNAME set-record = 1) az network dns zone create -g RG -n myapp.com
    2) az network dns record-set a add-record -g RG -z myapp.com -n app -a 192.168.1.10
    3) az network dns record-set cname set-record -g RG -z myapp.com -n www -c app.myapp.com [OK]
Hint: Use 'add-record' for A, 'set-record' for CNAME [OK]
Common Mistakes:
  • Using wrong commands like 'az dns zone create'
  • Mixing up 'add-record' and 'set-record' for CNAME
  • Assigning IP to CNAME record
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard