{
    "id": "179e1d48-fae9-4bfe-9a71-62cd88f37494",
    "name": "Implement Private Azure DNS",
    "slug": "implement-private-azure-dns",
    "status": "published",
    "lab_type": "pta",
    "is_sample": false,
    "duration_in_seconds": 1800,
    "metadata": {
        "courses": [
            "26f9ad91-c452-41bd-87ea-284a1e3de3f3",
            "9d8d4179-9915-4895-95e6-178f7ca69436",
            "6ebab230-9dc9-4ce8-b913-9d0272210bbe",
            "1684bedc-e75a-42a8-8912-6d5cd3cff45c"
        ],
        "pta_sdn": "348",
        "pta_namespace": "my.ine",
        "learning_paths": [],
        "has_published_parent": true
    },
    "session": null,
    "company": "a491bc32-c056-4946-9169-cc053387bada",
    "created": "2022-09-10T21:27:29.601795Z",
    "modified": "2023-10-03T18:58:30.566266Z",
    "is_beta": false,
    "lab_objectives": [],
    "main_learning_area": "d3f82c70-f4e7-428e-afd7-4b1d28988e18",
    "learning_areas": [
        {
            "id": "d3f82c70-f4e7-428e-afd7-4b1d28988e18",
            "name": "Cloud",
            "slug": "cloud"
        }
    ],
    "categories": [],
    "tags": [],
    "difficulty": null,
    "is_web_access": true,
    "is_lab_experience": false,
    "is_featured": false,
    "cve": null,
    "severity": null,
    "year": null,
    "classification": null,
    "is_trackable": false,
    "cpe_credits": null,
    "is_skill_check": false,
    "external_url": "",
    "solution_video": null,
    "explanation_video": null,
    "description": "The goal of this task is to associate a private DNS zone with two virtual networks. It will serve as the registration DNS zone for one virtual network and a resolution DNS zone for the other.",
    "description_html": "<p>The goal of this task is to associate a private DNS zone with two virtual networks. It will serve as the registration DNS zone for one virtual network and a resolution DNS zone for the other.</p>",
    "tasks": "",
    "tasks_html": "",
    "published_date": "2020-12-10T21:09:05Z",
    "solutions": "# Provision a private DNS zone\n\nWhen you will login to your azure portal with the generated credentials. You will see that there are some resources pre created for you.\n\nThis all you will need to work with this lab.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/1.png)\n\nFor creating Private Azure DNS, you can use cloudshell, powershell or the azure portal.\n\nI am going to show you the procedure with powershell environment of cloud shell.\n\nAccess the cloudshell with below link.\n\n```\nhttps://shell.azure.com\n```\n\nClick on **Powershell**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/2.png)\n\nUse **Show advanced settings** to configure storage for cloudshell.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/3.png)\n\nGive a unique name for storage account and file share. Then click on **Create storage**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/4.png)\n\nA powershell environment of cloudshell will open in your browser.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/5.png)\n\nInstall the neccessary module for azure private DNS using below command.\n\n```\nInstall-Module -Name Az.PrivateDns -force\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/6.png)\n\nNow create a private DNS zone using the below command and give it a name as **ine-student.task**.\n\n```\n$zone = New-AzPrivateDnsZone -ResourceGroupName user_ZA8DEZGL9H_Playground -Name ine-student.task\n```\n\n**Note:** Use the resource group which is assigned to you.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/7.png)\n\n# Implement a registration zone\n\nUse the below command to set the **vnet** variable to point to **public-vnet**.\n\n```\n$vnet = Get-AzVirtualNetwork -ResourceGroupName user_ZA8DEZGL9H_Playground -Name public-vnet\n```\n\n* Use the resource group which is assigned to you\n\nNow use the below command to create a virtual network link with public-vnet and setting it up as a registration zone.\n\n```\nNew-AzPrivateDnsVirtualNetworkLink -Name public-link -ZoneName ine-student.task -ResourceGroupName user_ZA8DEZGL9H_Playground -VirtualNetworkId $vnet.Id -EnableRegistration\n```\n\n* Use the resource group which is assigned to you\n* Name the virtual network link as **public-link**\n* Give the zone name which we just created with **-ZoneName**\n* Use the virtual network public-vnet with the **vnet** variable\n* Use **-EnableRegistration** to set it as a registration zone.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/8.png)\n\n# Implement a resolution zone\n\nUse the below command to set the **vnet** variable to point to **hub-vnet**.\n\n```\n$vnet = Get-AzVirtualNetwork -ResourceGroupName user_ZA8DEZGL9H_Playground -Name hub-vnet\n```\n\n* Use the resource group which is assigned to you\n\nNow use the below command to create a virtual network link with hub-vnet and setting it up as a resolution zone.\n\n```\nNew-AzPrivateDnsVirtualNetworkLink -Name hub-link -ZoneName ine-student.task -ResourceGroupName user_ZA8DEZGL9H_Playground -VirtualNetworkId $vnet.Id\n```\n\n* Use the resource group which is assigned to you\n* Name the virtual network link as **hub-link**\n* Give the zone name which we just created with **-ZoneName**\n* Use the virtual network hub-vnet with the **vnet** variable\n* Not using **-EnableRegistration** will set it as a resolution zone.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/9.png)\n\nYou can go to the portal and check the **Virtual netwrok links** in the private DNS zone we created. You will find both the links.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/10.png)\n\n# Test resolution\n\nFirst go to the **Deployments** of your assigned resource group. You can see a deployment name **Private-DNS-IP-Addressing**, click on it.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/11.png)\n\nGo to the **Outputs** and copy the password. We will use it to connect to the virtual machines.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/12.png)\n\nNow go to the **public-web2-vm** and open the **Connect**. Here go to bastion and click on **Use Bastion**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/13.png)\n\nUse the **public-bastion**. Enter the username as **student**, use the copied password and click on **Connect**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/14.png)\n\nA SSH session will open in a new tab in your browser.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/15.png)\n\nUse the below command in public-web2-vm.\n\n```\ncurl public-web1.ine-student.task\n```\n\nIf you get the output as below, which is the name of web1 VM. This means that you have configured the private DNS zone properly.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/16.png)\n\nIn the same manner go to the hub VM and connect to it with the same creadentials, using **hub-bastion**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/17.png)\n\nUse the same command as above in the hub VM also.\n\n```\ncurl public-web1.ine-student.task\n```\n\nYou will get the same output which is name of web1 VM's name.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/18.png)\n\n**Note:** We had peering relationship between these two virtual networks. You could have used any of the bastion hosts to connect to any of the virtual machines. \n\nOur lab is now complete.",
    "solutions_html": "<h1>Provision a private DNS zone</h1>\n<p>When you will login to your azure portal with the generated credentials. You will see that there are some resources pre created for you.</p>\n<p>This all you will need to work with this lab.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/1.png\" /></p>\n<p>For creating Private Azure DNS, you can use cloudshell, powershell or the azure portal.</p>\n<p>I am going to show you the procedure with powershell environment of cloud shell.</p>\n<p>Access the cloudshell with below link.</p>\n<pre class=\"codehilite\"><code>https://shell.azure.com</code></pre>\n\n<p>Click on <strong>Powershell</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/2.png\" /></p>\n<p>Use <strong>Show advanced settings</strong> to configure storage for cloudshell.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/3.png\" /></p>\n<p>Give a unique name for storage account and file share. Then click on <strong>Create storage</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/4.png\" /></p>\n<p>A powershell environment of cloudshell will open in your browser.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/5.png\" /></p>\n<p>Install the neccessary module for azure private DNS using below command.</p>\n<pre class=\"codehilite\"><code>Install-Module -Name Az.PrivateDns -force</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/6.png\" /></p>\n<p>Now create a private DNS zone using the below command and give it a name as <strong>ine-student.task</strong>.</p>\n<pre class=\"codehilite\"><code>$zone = New-AzPrivateDnsZone -ResourceGroupName user_ZA8DEZGL9H_Playground -Name ine-student.task</code></pre>\n\n<p><strong>Note:</strong> Use the resource group which is assigned to you.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/7.png\" /></p>\n<h1>Implement a registration zone</h1>\n<p>Use the below command to set the <strong>vnet</strong> variable to point to <strong>public-vnet</strong>.</p>\n<pre class=\"codehilite\"><code>$vnet = Get-AzVirtualNetwork -ResourceGroupName user_ZA8DEZGL9H_Playground -Name public-vnet</code></pre>\n\n<ul>\n<li>Use the resource group which is assigned to you</li>\n</ul>\n<p>Now use the below command to create a virtual network link with public-vnet and setting it up as a registration zone.</p>\n<pre class=\"codehilite\"><code>New-AzPrivateDnsVirtualNetworkLink -Name public-link -ZoneName ine-student.task -ResourceGroupName user_ZA8DEZGL9H_Playground -VirtualNetworkId $vnet.Id -EnableRegistration</code></pre>\n\n<ul>\n<li>Use the resource group which is assigned to you</li>\n<li>Name the virtual network link as <strong>public-link</strong></li>\n<li>Give the zone name which we just created with <strong>-ZoneName</strong></li>\n<li>Use the virtual network public-vnet with the <strong>vnet</strong> variable</li>\n<li>Use <strong>-EnableRegistration</strong> to set it as a registration zone.</li>\n</ul>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/8.png\" /></p>\n<h1>Implement a resolution zone</h1>\n<p>Use the below command to set the <strong>vnet</strong> variable to point to <strong>hub-vnet</strong>.</p>\n<pre class=\"codehilite\"><code>$vnet = Get-AzVirtualNetwork -ResourceGroupName user_ZA8DEZGL9H_Playground -Name hub-vnet</code></pre>\n\n<ul>\n<li>Use the resource group which is assigned to you</li>\n</ul>\n<p>Now use the below command to create a virtual network link with hub-vnet and setting it up as a resolution zone.</p>\n<pre class=\"codehilite\"><code>New-AzPrivateDnsVirtualNetworkLink -Name hub-link -ZoneName ine-student.task -ResourceGroupName user_ZA8DEZGL9H_Playground -VirtualNetworkId $vnet.Id</code></pre>\n\n<ul>\n<li>Use the resource group which is assigned to you</li>\n<li>Name the virtual network link as <strong>hub-link</strong></li>\n<li>Give the zone name which we just created with <strong>-ZoneName</strong></li>\n<li>Use the virtual network hub-vnet with the <strong>vnet</strong> variable</li>\n<li>Not using <strong>-EnableRegistration</strong> will set it as a resolution zone.</li>\n</ul>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/9.png\" /></p>\n<p>You can go to the portal and check the <strong>Virtual netwrok links</strong> in the private DNS zone we created. You will find both the links.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/10.png\" /></p>\n<h1>Test resolution</h1>\n<p>First go to the <strong>Deployments</strong> of your assigned resource group. You can see a deployment name <strong>Private-DNS-IP-Addressing</strong>, click on it.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/11.png\" /></p>\n<p>Go to the <strong>Outputs</strong> and copy the password. We will use it to connect to the virtual machines.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/12.png\" /></p>\n<p>Now go to the <strong>public-web2-vm</strong> and open the <strong>Connect</strong>. Here go to bastion and click on <strong>Use Bastion</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/13.png\" /></p>\n<p>Use the <strong>public-bastion</strong>. Enter the username as <strong>student</strong>, use the copied password and click on <strong>Connect</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/14.png\" /></p>\n<p>A SSH session will open in a new tab in your browser.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/15.png\" /></p>\n<p>Use the below command in public-web2-vm.</p>\n<pre class=\"codehilite\"><code>curl public-web1.ine-student.task</code></pre>\n\n<p>If you get the output as below, which is the name of web1 VM. This means that you have configured the private DNS zone properly.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/16.png\" /></p>\n<p>In the same manner go to the hub VM and connect to it with the same creadentials, using <strong>hub-bastion</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/17.png\" /></p>\n<p>Use the same command as above in the hub VM also.</p>\n<pre class=\"codehilite\"><code>curl public-web1.ine-student.task</code></pre>\n\n<p>You will get the same output which is name of web1 VM's name.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/implement-private-azure-dns/18.png\" /></p>\n<p><strong>Note:</strong> We had peering relationship between these two virtual networks. You could have used any of the bastion hosts to connect to any of the virtual machines. </p>\n<p>Our lab is now complete.</p>",
    "flags": [],
    "min_points_to_pass": null,
    "access_type": "web",
    "user_status": "unstarted",
    "user_lab_status": null,
    "user_status_modified": null,
    "user_flags": [],
    "global_running_session": null
}