7/29/09

Why geo dns - setting up geodns on fedora part 1

First of all, what is geodns? Let's look at an example. The following show the outputs of dig and ping on www.google.com from 3 different geographical locations.
First from Dallas:

270 06:13 PM wang@ns1)dig www.google.com +short
www.l.google.com.
74.125.47.99
74.125.47.103
(truncated)
271 06:13 PM wang@ns1)ping -c 2 www.google.com
PING www.l.google.com (74.125.47.99) 56(84) bytes of data.
64 bytes from yw-in-f99.google.com (74.125.47.99): icmp_seq=1 ttl=54 time=21.2 ms
64 bytes from yw-in-f99.google.com (74.125.47.99): icmp_seq=2 ttl=54 time=21.0 ms
Next from Xi'an, China:
[wang@www ~]$ dig www.google.com +short
www.l.google.com.
64.233.189.104
64.233.189.147
64.233.189.99
[wang@www ~]$ ping -c 2 www.google.com
PING www.l.google.com (64.233.189.147) 56(84) bytes of data.
64 bytes from hk-in-f147.google.com (64.233.189.147): icmp_seq=1 ttl=242 time=45.7 ms
64 bytes from hk-in-f147.google.com (64.233.189.147): icmp_seq=2 ttl=242 time=45.8 ms
Finally from Zhejiang China:
137 03:06 PM wang@cn)dig www.google.com +short
www.l.google.com.
66.249.89.99
66.249.89.104
66.249.89.147
138 03:06 PM wang@cn)ping -c 2 www.google.com
PING www.l.google.com (66.249.89.99) 56(84) bytes of data.
64 bytes from jp-in-f99.google.com (66.249.89.99): icmp_seq=1 ttl=243 time=47.4 ms
64 bytes from jp-in-f99.google.com (66.249.89.99): icmp_seq=2 ttl=243 time=47.4 ms
You can see the IP's for www.google.com from these locations are different. The reason for this is that Google want to send www.google.com visitors to their nearest web servers. Why? you might ask. Because of network latency. Here's output from pinging US google server from China:
[wang@www ~]$ ping 74.125.47.99 -c 2
PING 74.125.47.99 (74.125.47.99) 56(84) bytes of data.
64 bytes from 74.125.47.99: icmp_seq=1 ttl=44 time=258 ms
64 bytes from 74.125.47.99: icmp_seq=2 ttl=44 time=261 ms
So the ping time is >10 times as long as ping time from within US. If Google doesn't have servers in China (or hk, jp, or whatever closer to China), the experience of Chinese www.google.com visitors will be really bad (long response time, slow page load).

The 3 popular DNS software (bind, powerdns, tinydns) all have geo capability, either with patch, backend, or in tinydns case, a fork called geoipdns. I have been using Tinydns for several years and very satisfied with its ease of use and performance. So I stick with Tinydns for my geodns.
The geodns fork of Tinydns is called geoipdns, it's written by Adrian Ilarion Ciobanu.
I will talk about how to set up Geoipdns in the next post.

1 comment:

Anonymous said...

Hi

Can you provide the geo location patch for DjbDns.