Hi,
I use the payed version of the maxmind country db with ruby-pdns. I have this geo zone defined:
[code]
module Pdns
   newrecord("
zone.domain.com") do |query, answer|
       case country(query[:remoteip])
       when "DZ", "AO", "BJ", "BW", "BF", "BI", "CM", "CV", "CF", "TD", "KM", "CD", "CG", "CI", "DJ", "EG", "GQ", "ER", "ET", "GA", "GM", "GH", "GN", "GW", "KE", "LS", "LR", "LY", "MG", "MW", "ML", "MR", "MU", "MA", "MZ", "NA", "NE", "NG", "RW", "ST", "SN", "SC", "SL", "SO", "ZA", "SD", "SZ", "TZ", "TG", "TN", "UG", "EH", "ZM", "ZW", "AL", "AD", "AT", "BY", "BE", "BA", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "GE", "DE", "GR", "HU", "IS", "IE", "IT", "LV", "LI", "LT", "LU", "MK", "MT", "MD", "MC", "ME", "NL", "NO", "PL", "PT", "RO", "RU", "SM", "RS", "SK", "SI", "ES", "SE", "CH", "UA", "GB", "VA"
           answer.content "1.1.1.1" #5
           answer.ttl 3600
       when "US", "CA", "MX", "AR", "BO", "BR", "CL", "CO", "EC", "GY", "PY", "PE", "SR", "UY", "VE", "AG", "BS", "BB", "BZ", "KY", "CR", "CU", "DM", "DO", "SV", "GL", "GD", "GT", "HT", "HN", "JM", "NI", "PA", "PR", "KN", "LC", "VC", "TT", "TC"
           answer.content "2.2.2.2" #5
           answer.ttl 3600
       when "AM", "IR", "IQ", "ID", "IL"
           answer.content "1.1.1.1" #5
           answer.ttl 3600
       when "ZW", "YE", "PK", "HK"
           answer.content "1.1.1.1" #5
           answer.ttl 3600
       when "IN", "DE"
           answer.content "1.1.1.1" #5
           answer.ttl 3600
       else
           answer.content "2.2.2.2" #5
           answer.ttl 120
       end
   end
end
[/code]
I have 3 dns servers, one master the other slaves. I use the rsync command to propagate changes from master to slaves.
I used this command on a server from US for testing:
[code]
[root@secure3 ~]# dig
zone.domain.com @
ns1.dnsserver.com[/code]
Now the problem is that the DNS server responds randomly with either 1.1.1.1 or 2.2.2.2 regardless that the US source country should resolve to 2.2.2.2.
Can you please tell me if I am doing something wrong?
Thanks