Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to setup something similar to a CDN (Content Delivery Network) setup. What I want to do is use DNS records that return an A record based on where the user is geographically located. I was able to setup that using RAGE4 DNS. I can't really move the domain (lets call it domaina.com) to RAGE4 and I can only change the subdomain. So, what I've done is registered a new domain name (lets call it domainb.com) and have that setup on RAGE4 DNS with the geographic based A records and changed the subdomain (on domaina.com) to a CNAME which points to the RAGE4 DNS. This causes the A records returned by accessing the subdomain (on domainb.com) to only return the same IP address because its using the location of the nameserver for domaina.com (and not the original user who performed the query).

Maybe this is a better explanation:

  • User requests DNS record for xyz.domaina.com from ns1.domaina.com
  • xyz.domaina.com is a CNAME record which points to xyz.domainb.com
  • xyz.domainb.com returns an A record based on the geographic location of the user (in this case, it's the geographic location of ns1.domaina.com)

Are there anyways to get it to use the original users location instead of the name servers location?

share|improve this question
BTW, I don't see how this question is related to CNAME. You're most likely getting the location of the resolver that the user is using, instead of any other intermediate servers, and results wouldn't differ even if it weren't for CNAME. I've personally tried using rage4 dns for a subdomain, but they did not met my expectations, and I ended up doing my own split horizon, which works just so much better. –  cnst Apr 22 '14 at 2:53
@cnst What "expectations" weren't met? –  ub3rst4r Apr 22 '14 at 3:20
I don't recall now, but, basically, i found their geodns to be too flawed to be useful, and the interface to be too cumbersome; they also had very weird anycast, where their servers would always be on another continent and with 200ms latency (even though they always had servers nearby, but those nearby servers were only available from the other continents!); also, their own New York test server wasn't GeoDNS'ed to NY, for example! With an in-house split-horizon, I got exactly what I wanted, without having to jump through any hoops, and never looked back. –  cnst Apr 22 '14 at 3:39

1 Answer 1

up vote 1 down vote accepted

You can't.

There's an EDNS0 extension called "Client Subnet in DNS Requests", and it's already supported by some resolvers like Google Public DNS and OpenDNS (but not by Level3, Dyn, Hurricane Electric or most other providers). Last time I checked, there was still pretty much no support for things like this in any publicly available open-source software, hence only Google and OpenDNS resolvers support it.

Some related question:

Some relevant troubleshooting answer:

In short, try running dig -t txt o-o.myaddr.l.google.com +short from a potential client of yours. If you aren't seeing edns0-client-subnet in the output, then all bets are off.

% dig -t txt o-o.myaddr.l.google.com +short

% dig @google-public-dns-a.google.com. -t txt o-o.myaddr.l.google.com +short

% dig @resolver1.opendns.com. -t txt o-o.myaddr.l.google.com +short

% dig @a.resolvers.level3.net. -t txt o-o.myaddr.l.google.com +short

% dig @resolver1.dyndnsinternetguide.com. -t txt o-o.myaddr.l.google.com +short

% dig @ordns.he.net -t txt o-o.myaddr.l.google.com +short

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.