Weighted Round Robin based Responses and geo stuff

63 views
Skip to first unread message

Bursuc Sergiu

unread,
Mar 21, 2013, 8:00:48 AM3/21/13
to ruby-pd...@googlegroups.com
Hi,

For example I have geo dns stuff added for a record.

from US resolves to 1.1.1.1, 2.2.2.2, 3.3.3.3
from other countries to 4.4.4.4, 5.5.5.5

Is it possible to add weighted round robin based responses to these?

If yes, how would I do it?

In this example wiki:
http://code.google.com/p/ruby-pdns/wiki/RecipeWeightedRoundRobin

What does
        answer.content ips[0]
        answer
.content ips[1]
        answer
.content ips[2]
mean?

Please advise
Thanks

R.I.Pienaar

unread,
Mar 21, 2013, 8:05:38 AM3/21/13
to ruby-pd...@googlegroups.com
# 4 possible ip addresses
ips = ["1.x.x.x", "2.x.x.x", "3.x.x.x", "4.x.x.x", "5.x.x.x"]

# shuffle them by weight
ips = ips.randomize([1,5,3,3,3])

# add only the first 3 of the 4 total to the answer
answer.content ips[0]
answer.content ips[1]
answer.content ips[2]

so this will work with geo, just combine the approaches

Bursuc Sergiu

unread,
Mar 21, 2013, 8:14:19 AM3/21/13
to ruby-pd...@googlegroups.com
So do I put these in the same .prb file with the geo dns stuff? Or do I create a separate file?

Thanks

R.I.Pienaar

unread,
Mar 21, 2013, 8:41:28 AM3/21/13
to ruby-pd...@googlegroups.com


----- Original Message -----
> From: "Bursuc Sergiu" <izg...@gmail.com>
> To: ruby-pd...@googlegroups.com
> Sent: Thursday, March 21, 2013 12:14:19 PM
> Subject: [ruby-pdns-users] Re: Weighted Round Robin based Responses and geo stuff
>
> So do I put these in the same .prb file with the geo dns stuff? Or do I
> create a separate file?

each record goes in a single file, just try it, if it doesnt work, show what
you tried.
Reply all
Reply to author
Forward
0 new messages