[GH-ISSUE #50] clarification on how to set different answer per geo #185

Open
opened 2026-03-01 17:24:25 +03:00 by kerem · 4 comments
Owner

Originally created by @anuaimi on GitHub (Jan 8, 2014).
Original GitHub issue: https://github.com/abh/geodns/issues/50

I've got geodns up and running with a sample zone file. What's not clear is how I set different answers for different Geos. Do I just add the geo after the record name. As an example:

"www" : { "a" : "192.168.0.1" },
"www.us" : { "a" : "192.168.1.1" },
"www.ca" : " { "a" : "192.168.2.1"},
"www.europe" : {"a" : 192.168.3.1" }

And is there a way to have different answers for different US states?

thanks in advance

Originally created by @anuaimi on GitHub (Jan 8, 2014). Original GitHub issue: https://github.com/abh/geodns/issues/50 I've got geodns up and running with a sample zone file. What's not clear is how I set different answers for different Geos. Do I just add the geo after the record name. As an example: "www" : { "a" : "192.168.0.1" }, "www.us" : { "a" : "192.168.1.1" }, "www.ca" : " { "a" : "192.168.2.1"}, "www.europe" : {"a" : 192.168.3.1" } And is there a way to have different answers for different US states? thanks in advance
Author
Owner

@abh commented on GitHub (Jan 13, 2014):

Yup, that's basically it!

To get different answers for US states you need the GeoCity database installed and then you add a "targeting" key in the zone json, like:

     "targeting": "@ continent country regiongroup region",

@, continent, country are the defaults. regiongroup are "us-west", "us-central" and "us-east". region are "us-ca", "us-az", "us-ny", etc. Regions are only supported for the US.

Ask

<!-- gh-comment-id:32149681 --> @abh commented on GitHub (Jan 13, 2014): Yup, that's basically it! To get different answers for US states you need the GeoCity database installed and then you add a "targeting" key in the zone json, like: ``` "targeting": "@ continent country regiongroup region", ``` @, continent, country are the defaults. regiongroup are "us-west", "us-central" and "us-east". region are "us-ca", "us-az", "us-ny", etc. Regions are only supported for the US. Ask
Author
Owner

@aredondo commented on GitHub (May 13, 2014):

With subdomains, this works fine. But how can I add geo-based responses for the apex? I have tried:

  • ".europe": { "a": [ [ … ] ] }
  • "domain.europe": { "a": [ [ … ] ] }
  • "domain..europe": { "a": [ [ … ] ] }
  • "@.europe": { "a": [ [ … ] ] }

But none seem to work.

In addition, an entry without geographic information is used as default when the source of the request cannot be determined?

<!-- gh-comment-id:43027727 --> @aredondo commented on GitHub (May 13, 2014): With subdomains, this works fine. But how can I add geo-based responses for the apex? I have tried: - ".europe": { "a": [ [ … ] ] } - "domain.europe": { "a": [ [ … ] ] } - "domain..europe": { "a": [ [ … ] ] } - "@.europe": { "a": [ [ … ] ] } But none seem to work. In addition, an entry without geographic information is used as default when the source of the request cannot be determined?
Author
Owner

@abh commented on GitHub (May 14, 2014):

Simpler than you thought! :-)

For the default records:

  • "": { "a": ... }

target to europe:

  • "europe": { "a": ... }

etc.

<!-- gh-comment-id:43043850 --> @abh commented on GitHub (May 14, 2014): Simpler than you thought! :-) For the default records: - "": { "a": ... } target to europe: - "europe": { "a": ... } etc.
Author
Owner

@ghpass commented on GitHub (Dec 15, 2015):

maybe "europe" is a host name. so how to make a distinction between host name and region?
I don't know how to configure as the feature "view" in bind.

<!-- gh-comment-id:164657204 --> @ghpass commented on GitHub (Dec 15, 2015): maybe "europe" is a host name. so how to make a distinction between host name and region? I don't know how to configure as the feature "view" in bind.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/geodns#185
No description provided.