HiBlog

What Is GeoDNS? Sending Each Visitor to the Right Server with DNS

  • Ali GhanimatiAuthor
  • Release Date
  • 5 minutesReading time
  • 8Views
  • Ali Ghanimati
  • Published:
  • 5 min read
  • 8 views
What Is GeoDNS? Sending Each Visitor to the Right Server with DNS

Your site is hosted in Iran and loads fast for customers inside the country, but a colleague in Dubai says the page barely opens, and Search Console is showing more crawl errors. Every time Iran’s international connectivity gets shaky, Googlebot and foreign visitors are left waiting at the door. GeoDNS was made for exactly this: each visitor is sent to the right server depending on where they come from.

In this article we explain what GeoDNS is and how it works, how it differs from a CDN and Anycast, where it’s useful and how HiData sets it up for your site.

Short answer: GeoDNS is geographic DNS: it doesn’t give everyone the same answer, but returns the IP of a closer or more suitable server depending on where the request comes from. For example, a visitor inside Iran gets the Iran host’s IP, while foreign visitors and Googlebot get the IP of the copy abroad. GeoDNS doesn’t cache content itself; it only picks the route.

How does GeoDNS work?

When someone opens your site, their device asks its internet provider’s DNS, called a resolver, for the domain’s IP, and the resolver asks the domain’s nameserver. With ordinary DNS, the nameserver gives everyone the same answer; a GeoDNS nameserver looks at which country the question came from and, following the rules you’ve set, returns the IP of one of your servers. The browser then connects straight to that server.

A GeoDNS nameserver checks where the request comes from and sends the visitor to the server for their region

The key point is that the nameserver usually sees the resolver’s location, not the user’s. Some public DNS services, such as Google Public DNS, send part of the user’s IP along with the question (EDNS Client Subnet), which makes the answer more accurate, while others, such as Cloudflare’s 1.1.1.1, don’t, to protect privacy. So a user in Iran who uses a foreign DNS may end up at the copy abroad.

Like any other DNS record, a GeoDNS answer stays in resolvers’ caches for its TTL. That’s why GeoDNS records usually get a short TTL, a few minutes for example, so that a switch takes effect quickly if a server goes down.

What is GeoDNS used for?

  • Iranian sites with a foreign audience: local users get the speed of the Iran host, while Googlebot and foreign visitors see the copy abroad, even when Iran’s international connectivity is unstable.
  • Services in several data centers: each region goes to the nearest data center and network latency drops.
  • Failover during outages: if the GeoDNS service checks your servers’ health, it leaves a failed server out of its answers and visitors reach a healthy one.
  • Regional rules: some services keep each country’s user data on a server in that country, and GeoDNS sends every user to the server for their country.

GeoDNS vs CDN vs Anycast

GeoDNSCDNAnycast
Where the decision is madeIn the DNS answerOn the CDN’s edge serversIn internet routing (BGP)
What it doesReturns the IP of the right serverServes cached copies of files from the nearest nodeOne IP is announced from several places and the nearest one answers
Where the content isOn your own serversCopies on the CDN’s serversOn every location

These three aren’t rivals and they work side by side; many CDNs themselves use GeoDNS or Anycast to bring users to the nearest node. If you want to put your site behind a CDN, see How to Set Up Cloudflare for Your Website.

FAQ

Does GeoDNS hurt SEO?

Not if both copies show the same content. Google crawls mostly from outside Iran and sees the copy abroad, so a stable copy abroad helps regular crawling. The risk is when the copy abroad goes stale and Google indexes old content.

Do I need a separate server for GeoDNS?

Not always. Services such as Amazon Route 53 have location-based routing rules, and Cloudflare does this with its paid Load Balancing service. HiData’s way is a small virtual server abroad that runs GeoDNS for your site alone.

GeoDNS for your site at HiData

If your site is on Iran hosting and foreign visitors and search engine crawlers matter to you too, HiData sets up GeoDNS on your service. A matching copy of your site is placed on a host outside Iran and GeoDNS runs on a virtual server abroad; users inside Iran reach the Iran host, and everyone else, Googlebot included, reaches the copy abroad.

The Iran host answers users inside the country, the copy abroad answers everyone else, and GeoDNS picks the route between them
  • A host outside Iran for the copy of your site; it doesn’t need many resources, because it only serves foreign visitors and crawlers.
  • A virtual server outside Iran to connect the domain and run GeoDNS; a 1 GB RAM plan is enough.

The backup moved to build the copy abroad can be up to 2 GB. The copy abroad isn’t synced with the Iran host automatically, so whenever you change important content, update the copy too. To get started, open a ticket with HiData support from your client area and we’ll take it from there!

Share Post

hidata.org/en/blog/what-is-geodns-and-how-it-works/
In Social Media

Add Comment

Related Articles