1. Home
  2. GSLB
  3. How To
  4. Snapt Aria: GSLB Setup Guide

Snapt Aria: GSLB Setup Guide

Welcome to the Snapt Aria Global Server Load Balancer (GSLB) Setup Guide. The Snapt Aria GSLB is used to route DNS queries around the globe to your datacenters. Use cases can include routing all traffic to your primary datacenter and if that data center goes down, we can route traffic to your standby datacenter.

The second use case we see frequently is to route users to their closest geographical location based on the country where the DNS query is coming from.


Prerequisites

  • Registered Domain (i.e. snapt.net)
  • Access to manage DNS entries on registered domain
  • At least 1 Snapt VM deployed and GSLB plugin installed. (2 Snapt VM’s are recommended for high availability)

Step 1: Zone Creation

Head over to GSLB and then click on Zones

Then we and to click on “ADD ZONE”

After clicking on “ADD ZONE” you’ll find a form that needs to be completed.

Zone DNS Name

Please enter a subdomain here. Remember that this subdomain will need to be created on your domain, and delegated to the GSLB. We recommend naming this in the likes of ha.{yourdomainname.com} (Remember that {yourdomainname.com} is just our place holder.) or gslb.{yourdomainname.com}

Zone NS1 & Zone NS2

For this setup guide, we’ll name our NS1 and NS2 records NS1 and NS2, but you can also name this something else (i.e. pluto and mars)

Please do take note of these values as they will be required later on when we configure our DNS entries on our domain side.

After click “Add” we’ll see our entry as below:

Step 2: Health Checks

Health checks of your endpoints is a critical function of the GSLB, and these will be required to be configured before Hosts Creation (Step 3). For this, we want to go to GSLB > Health Checks

And then click on “ADD HEALTH CHECKS”

We will then need to complete the form presented to us on screen.

Name: The name of the Health Check. For example, you might call this USA Data Center if we are going to check if our USA Data Center is ready and online.
Type: This is where we can set the type of health check we want. HTTP, TCP, or ICMP. We recommend using HTTP where ever possible. The latter one, ICMP, should only be used under extreme caution. ICMP packet can easily be dropped from routers or on the firewall. Causing false negatives about the health status of your endpoint.
IP: This should be the IP address of your service.
Check Port: For typical web traffic, port 80 or 443 can be used. Please do change this depending on your use case being configured.

Step 3: Hosts creation

Now, we’ll create our Hosts. This is wherein you’ll define your A, MX, CNAME, etc, records. So we’ll click on the “Hosts” button

Next, we want to click on “Add Host”

And we will then be presented with the following field to complete

Host Name

Depending on how you want to configure your GSLB, you might want to set your Host Name to “docs” (if you want to Balance your document site docs.snapt.tk). Just remember that in our DNS on our domain, we will be pointing our docs.snapt.tk to this Hot Name on the GSLB. So do take note of that data is entered on this page.

Host Selection

We have 3 options here. Always, Country, and IP Range (CIDR). When selecting “Always”, the GSLB will always look up the requested DNS query (A, AAAA, Cname, etc) as configured in the DNS Entries section.

When selecting “Country”, we can then specify a country. This means that we can then tell the GSLB to respond with the DNS Entries below if the DNS queries are coming from the United States for example. This way, we can route DNS queries based on location to the nearest data center.

The other option we have is IP Range (CIDR), this is a more advanced option as you’d need to be aware of the IP Range from which DNS queries will be coming from. The range will need to add in the CIDR format.

DNS Entries

This section is for creating your DNS records/entries. Under “Type” you’ll find a range of commonly used entries. A, AAAA, CNAME, etc.

End Point will contain the value/IP Address for your DNS Entry.

Health Check will be required when having (A) or (AAAA) DNS type. You will need to have created these Health Checks beforehand. If not, please see Step 2 above.

Weight: Should you wish to have more traffic flow to one endpoint, you can change the weighting here. This will ensure that more traffic goes to one of your entries.

Backup: Backup is a great option to enable if you’re using the GSLB for DR related setups. For example, you can configure 2 (A) records, one pointing to your primary Data Center, and the second on to your DR Data Center. When your primary goes down, we can then use the Backup entry, to route traffic to in the event of a fullscale outage.

When “Add” this configuration, and head over to the GSLB Dashboard, we’ll find that the status of our DNS Zone is “DOWN”. This is because we now need to configure our DNS entries on our domain.

As a summary from our setup above, we have the following:

DNS Zone: gslb.snapt.tk
NS1: ns1.gslb.snapt.tk
NS2: ns2.gslb.snapt.tk

As we have two instances set up in high availability, our config will be replicated over to our standby/Slave instance. So in our example, ns1.gslb.snapt.tk will be pointing to our primary Snapt instance IP address and ns2.gslb.snapt.tk will be pointing to our standby instances IP address.

So for this, we’ll head over to our domain DNS management panel. In our case, this is on Cloudflare. As we’ll create two (A) records pointing to our instances.

Next up, we need to create 2 NS records (gslb.snapt.tk) pointing to our two A records we just created.

After a few minutes, depending on how fast your hosting provider can propagate your new DNS entries, you’ll see the status on the GSLB change to “UP”. This means that we can now start to route our DNS queries to the GSLB.

Step 4: Pointing to the GSLB

The last step now is to point our website, in our case, we’ll point docs.snapt.tk to our GSLB to handle the queries. For this, we’ll go back into our Cloudflare account to configure a CNAME record. This will point to docs.gslb.snapt.tk

Testing

To ensure that our setup is working correctly, we’ll open up “nslookup” to perform a DNS query. We’ll also change our DNS server to which we are requesting this request to 8.8.8.8. (Below is another example but from 1.1.1.1)

After setting the server, we’ll instruct nslookup to look for (A) record. So we use “set type=A”

And then we’ll issue the URL (docs.snapt.tk) and we get a response back.

 

 

 

Updated on May 14, 2020


Was this article helpful?