Azure, Technology

21. Configure Name Resolution

Contents

Azure DNS Services

DNS is like the phone book for the internet, it is how the domain names get translated to IP addresses.

Azure DNS Service Options

There are 3 main options

  1. Azure provides DNS (default)
    – no configuration required
    – can use hostnames to connect to machines on the same VNet without requiring FQDN
  2. You provide DNS (run your own DNS server)
  3. Azure Private DNS
    – this allows you run your own DNS services
    – create your own custom domain names and have them recognised by your VMs. EG: dev.local, staging.local
    – Only valid your own VNet, not valid on the internet
    – Doesn’t have to be registered
    – can have 2 – 34 labels: something.something
    – works from VNet to VNet for VMs
    – does not work for App Services

 

Create a Private DNS Zone

  1. From the Azure portal, search for “Private DNS zones”
  2. Click on Create
  3. Set subscription and Resource Group
  4. Give the zone a name, eg: myzone.local
  5. Set the location
  6. Click on Create

Link DNS zone to VNet

To use the DNS zone we need to link it to a Virtual Network

  1. Go to the newly created DNS zone
  2. Go to “Virtual Network Links”
  3. Click on Add
  4. Give the Network Link a name
  5. Set the subscription
  6. Choose the VNet from the dropdown list
  7. Enable Auto registration: as servers are created in the resource group they will get auto added to the DNS zone.
  8. Click OK

Testing DNS Zone

  1. Now add two VM’s to the VNet that the DNS zone is linked to.
  2. Go to the Private DNS Zone and you should see the two VMs records listed  with their names and IP addresses
  3. From here you can also manually add records
  4. Now you should be able to access the VMs using their names

 

Create a Public DNS Zone

Before setting this up you will need a registered domain name that can be recognised from the internet. By setting this up Azure will be managing your Domains DNS.

  1. From the Azure portal, search for “DNS zones”
  2. Click on Create DNS Zone
  3. Set subscription and Resource Group
  4. Give the zone a name, this is the registered domain name
  5. Set the location
  6. Click on Create

 

Managing the Public DNS Zone

Go to the zone once It is created. You will see the existing records and the name servers for your domain.

Using Azure DNS for your domain:

  1. Go to the registrar of your domain and login
  2. Go to the DNS settings and enter the Azure Name servers found in your Azure DNS Zone

Leave a Reply

Your email address will not be published. Required fields are marked *