Providing a Domain Name for Grafana service in Azure Cloud

Introduction

In our previous tutorial, we installed Grafana on Ubuntu VM using Azure Cloud. The final result was getting some IP address with a port like 123.23.123.123:3000 to access the Grafana service. Yes, that is ok but having a proper, more meaningful name to access your Azure service is a better idea. In this article, we’ll talk about having an appropriate name for our Grafana service.

Understanding DNS

The Domain Name System (DNS) acts like the phonebook of the internet. The main 2 parts of DNS are,

  1. Domain Names: These are the user-friendly website addresses you type into your browser, like "wikipedia.org". They're easy to remember and use.
  2. IP Addresses: Every device connected to the internet has a unique numerical address called an IP address. These addresses are not very memorable, for example, 192.168.1.1.

DNS translates domain names into IP addresses that computers use to connect. When you type a domain name in your browser, your computer.

  1. Contacts a DNS server: This server could be provided by your internet service provider (ISP) or a public DNS server like Google Public DNS.
  2. Asks for the IP address: The DNS server checks its records to find the IP address associated with the domain name.
  3. Receives the IP address: The DNS server sends the IP address back to your computer.
  4. Connects to the website: Your computer uses the IP address to connect to the web server hosting the website.

This process happens very quickly behind the scenes, allowing you to access websites using easy-to-remember names instead of complex IP addresses.

Getting started with Azure DNS

Azure as a Cloud system, allows you not just to host your services but also access and configure them properly. Here is how we can configure DNS for our Grafana service.

PS: If you don’t know what Grafana is and how to install it to Azure, check out our tutorial.

First, go to portal.azure.com and navigate to the Virtual Machines section. Here you can find your already existing Virtual machines. From the list, select the exact VM you want to configure. In our case, we have only one VM called Ubuntu.

Virtual Machines

Click on “Ubuntu” VM and you’ll end up with subsections related to configuring your VM. From the list, select Settings->Properties.

Properties

Click on the “Public IP address/DNS name label” item. Make sure that the public IP you have to connect to VM is static. In a “DNS name label” and your DNS name to connect.

DNS name label

I have provided “mygrafana” but you can use any name you want. After providing a name, click the “Save” button at the top. That is pretty much all. Now it needs some time to recognize this Domain name. Your full name will be “the_name_you_provided.your_region_config_you_selected_when_creating_VM”. In my case, it is going to be mygrafana.eastasia.cloudapp.azure.com:3000.

After saving, you can check your DNS name in dnschecker.org

DNS name

It is usually fast, but overall, it may take up to 48 hours to fully map your IP address to the Domain name you provided. After some time, just try to navigate to http://mygrafana.eastasia.cloudapp.azure.com:3000, and you should the login page for Grafana.

Grafana

As you might see, we don’t have https and we have 3000 directly specified in our domain name. In our next tutorial, we’ll handle this issue.


Similar Articles