0

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?

SameOldNick
  • 566
  • 6
  • 23
  • 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 02:53
  • @cnst What "expectations" weren't met? – SameOldNick Apr 22 '14 at 03: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 03:39
  • OpenDNS has a blog post documenting EDNS0 client subnet extensions and explaining how it works a bit: http://www.afasterinternet.com/howitworks.htm The relevant IETF RFC7871 is available here: https://tools.ietf.org/html/rfc7871 – AdamKalisz Sep 19 '16 at 08:09

1 Answers1

2

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 8.8.8.8 and OpenDNS 208.67.222.222 (but not by Level3 4.2.2.1, Dyn 216.146.35.35, Hurricane Electric 74.82.42.42 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
"188.40.25.3"

% dig @google-public-dns-a.google.com. -t txt o-o.myaddr.l.google.com +short
"74.125.189.17"
"edns0-client-subnet 88.198.54.0/24"

% dig @resolver1.opendns.com. -t txt o-o.myaddr.l.google.com +short
"208.69.33.21"
"edns0-client-subnet 88.198.54.0/24"

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

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

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

%
cnst
  • 12,948
  • 7
  • 51
  • 75