Implementing GeoDNS with Gcore

Implementing GeoDNS with Gcore

Looking for the simplest way to allocate traffic between your servers and manage your complex infrastructure? GeoDNS can help you. GeoDNS helps you set rules that direct user requests only to servers you have pre-specified, usually geographically proximal to the users. Read on to understand what GeoDNS is, and how it can help your business.

What Is GeoDNS?

GeoDNS is a traffic-balancing technique. It is used for a scenario where a DNS server responds to your clients based on their locations. GeoDNS uses the IP address of your clients to determine their exact location on the world map and routes results to them based on the rules you have pre-set in the control panel of your DNS provider.

Suppose your web service has servers in Frankfurt, Shanghai, and Kumasi, and you have clients in Europe, Asia, and Ghana. GeoDNS enables you to direct requests from Europe to the Frankfurt server, from Asia to the Shanghai server, and from Africa to the Kumasi server, all with the aim of delivering content faster.

Generally, if a server fails your clients will be unable to access your services; a nightmare for any business that has competitors. Should that happen, GeoDNS will automatically reroute your clients’ requests to the closest available server.

Imagine a Black Friday with lower than expected revenue. Upon analyzing the causes, you realize an imbalance in the volume of orders: Customers in the United States could access your site and place orders easily, so the number of orders was high. However, very few orders came from your Chinese and EU markets, because your DNS server—located in the US—was too far away. This hampered their experience and impacted your revenue. You can easily prevent or resolve such scenarios by reconfiguring a few GeoDNS rules in your provider’s control panel.

How Does It Work?

Below is a step-by-step explanation of how GeoDNS works.

How GeoDNS works
  1. A client requests a resource from a DNS server, so the server’s IP is requested from the DNS resolver.
  2. The DNS resolver queries the authoritative DNS server for the IP of the client.
  3. The authoritative DNS looks up the client’s location in a GeoIP database.
  4. The GeoIP database responds with the client’s location.
  5. The authoritative DNS checks the RRset for predefined routing rules to route a response to the client’s location.
  6. The authoritative DNS fetches the IP for the client’s location.
  7. The authoritative DNS sends the IP to the DNS resolver.
  8. The DNS resolver then completes the request by routing traffic to the client.

How Does GeoDNS Work in Gcore?

Gcore provides an interface where you can set your own routing rules. Consider the image below.

Sample interface for latlong metadata in Gcore’s GeoDNS

Gcore also provides a fun, easy-to-use interactive map—with locations and corresponding parameters—that you can explore to define or update a server’s latlong (latitude and longitude) coordinates. The map has rich visualization features that you can use to verify that the coordinates entered are accurate. Below is an example of what the map looks like.

Map of affected areas for GeoDNS latlong records for Gcore DNS hosting
Visualization of two traffic distribution areas based on latlong information

From the latlong configuration in the map above, a user closer to the coordinate 40.43733088856228/-3.566434349995511 (the center of Madrid) will receive an A record with the value 127.0.0.1, while a user nearer to 52.20328569593686/21.081144277439293 (the center of Warsaw) will receive an A record with the value 127.0.0.2.

GeoDNS Use Cases

Gcore’s GeoDNS is not a one-size-fits-all solution. Rather, it provides tailored offerings based on your organization’s traffic routing goals and specific needs. Let’s take a look at four important use cases of Gcore’s GeoDNS.

Geobalancing For Lower Latency

Geobalancing is a DNS functionality used to deliver personalized responses based on the user’s location. Without geobalancing, one server delivers responses to users regardless of their location. The server can thus be overwhelmed by queries or may be too far from some users, causing latency problems. With geobalancing, companies specify that servers only serve requests from geographically proximate end users. This reduces the load on the main server, and results in lower latency for end users.

Low latency is crucial for many services, such as online gaming. The fast-growing, stiffly competitive industry needs ultra-fast query responses and low latency. A few seconds of lag when loading the game frustrates gamers and could mean a loss of revenue for the gaming service.

Take the example in the screenshot below. Using the Gcore interface, a gaming company’s admins can specify that two game servers (Record 1, Record 2) receive traffic from North America, the Asian server (Record 3) receives requests from Asia and Oceania, and the “global” server (Record 4) receives users from four continents—Antarctica, Africa, Europe, and South America.

Sample interface for latlong metadata for the gaming industry

Accurate Traffic Allocation

You can also use GeoDNS to direct users from a specific location to exclusively get served by servers prespecified in your rules. Per the screenshot below, streaming services can, for example, specify that:

  • Per Record 1, users from the Netherlands, Belgium, Denmark, and the UK are routed to a data center in Amsterdam (2a03:90c0:999d::1.)
  • Per Record 2, users from Europe are routed to a data center in Frankfurt (2a03:90c0:9992::1.)
  • Per Record 3, users from other parts of the world are routed to a data center in Santa Clara (95.85.95.85.)
Sample RRset for streaming services

This way, the content served to each can be more relevant, increasing the chances of customer conversion.

Load Balancing Among Internal Networks

If one smaller internet service provider (ISP) is consumed by another, bigger one, we can allocate traffic among their autonomous systems (AS) by designating necessary data centers based on ASN (AS numbers). This is called load balancing.

Stable Traffic Allocation Between Locations

We can also use Gcore’s GeoDNS to see covered areas and allocate traffic accordingly. Say, for instance, that a new fintech company has three locations. So, the company defines the latlong of three servers: Boston for North America, Dubai for Africa and the Middle East, and Seoul for Asia, as seen in the image below.

Sample RRset for finance

It then uses the map to visualize and verify the coordinates.

Map visualization for the sample RRsets for finance

Content Localization

With GeoDNS, businesses can serve location-specific content, products, or advertising campaigns to clients. This is particularly relevant to global businesses, such as video streaming, with different offerings and different currencies per location.

Suppose a global streaming app like Netflix wants to serve specific video content to end users in China, different from the content served to the rest of the world. The company’s admins can simply configure the RRsets as illustrated in the image below:

Sample RRsets for localizing content

Although the business can set redirects at the HTTP layer, setting up DNS records is also a solution.

In summary, Gcore’s GeoDNS has multiple use cases and is built to enable you to tailor routing choices to your specific use cases.

The Future of Gcore’s GeoDNS

Besides pure geobalancing via the RRsets, you can also balance by assigning specific IP addresses to particular requests; for example, an IP used only for API requests and another for database queries.

Gcore is dedicated to expanding its already robust functionality. We are implementing customer requests to make the Resource Record sets (RRsets) more advanced to give you even greater flexibility over the load-balancing process. Keep your eyes peeled for updates.

Conclusion

Using geolocation data and setting location-based DNS routing rules enables you to optimize load distribution and minimize latency. Even during downtimes, Gcore’s GeoDNS can help save the day by rerouting traffic to the nearest available server. What’s more, Gcore provides you with a fun interactive map with a dashboard of parameters to streamline and customize the GeoDNS functionality.

In addition to native GeoDNS, Gcore also offers other DNS balancing mechanisms such as weighted round robin (used to allocate specific percentages of traffic between servers), and balancing by specific IP. To enjoy any of these and see how they can help your organization, the GeoDNS functionality is available in a range of plans, from free to more advanced options. Try our GeoDNS functionality for free now!

Start for free now!

Subscribe and discover the newest
updates, news, and features

We value your inbox and are committed to preventing spam