Setting up a GeoDNS server, are custom nameservers required/adviced?

Posted January 16, 2017 9.1k views

So i’m looking to setup a DNS server that picks the closest Varnish caching server available based on what country the request is coming from.

This tutorial looks very good however i’m curious if running custom nameservers is required and if not, adviced. Can I also use Namecheaps nameservers and point domains to my GeoDNS server from Namecheaps admin panel?

I’m also curious if I would have to setup records for every country possible in order to get optimal geo distrubtion going. For instance when I have 1 server in Germany and 1 in The Netherlands and someone has a geo location of Poland (e.g, do I need to manually configure to go to the German server IP. If so, I would love some tips on how to deal with the matter.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


Instead of setting up a complex DNS configuration, you may want to look in to using NGINX to simply proxy to the closest Varnish server using GeoIP. The setup is less detailed and easier to replicate.

How To Use Nginx as a Global Traffic Director on Debian or Ubuntu

You’ll still need to create individual servers for each location you wish to handle, though if you look at the guide, there’s also a default server, which means for instances where there’s not a target defined, the default server will be used.

by Alex Soban
In this guide, we'll configure Nginx to detect and redirect customers to a subdomain that points to a more geographically appropriate server.