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?

  • 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
  • OpenDNS has a blog post documenting EDNS0 client subnet extensions and explaining how it works a bit: afasterinternet.com/howitworks.htm The relevant IETF RFC7871 is available here: tools.ietf.org/html/rfc7871 – AdamKalisz Sep 19 '16 at 8:09

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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