G
G
gagoman2013-05-13 23:33:23
Domain Name System
gagoman, 2013-05-13 23:33:23

Dynamic response with PowerDNS

Good evening.

We have:
a noob who has just started reading about DNS and a task:
to give different IPs through DNS depending on some conditions (visitor's IP). No, not Geo, but something nearby.

After reading the doc, I realized that you can use several backends, for example: postgresql + python script. If the data is not in postgre, then the python pipe script should give the answer.

Planned like this:
With a new request, if the given IP / network is not in the database, contact the Python backend, which, according to the logic, would give a record + add it to the database.

Problem:
I still don't understand if it's possible to modify gpgsql-basic-query or some other queries so that it takes IP into account? Or then everything should be written on the pipe backend?

And the second question:
I correctly understood that if you do not disable shuffle, then if there are several entries, powerdns will give different ones, and not just the first one?

Thank you in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
marklarius, 2013-05-14
@gagoman

1. It's easier to put logic into a script than to modify queries. I somehow built such a Geo-aware backend a long time ago, it has been working without interruption for a couple of years.
2. Shuffle has nothing to do with multiple responses, just the order in which they were returned (no shuffle: A, B, C; shuffle: C, B, A,)

V
Vladimir Pilipchuk, 2013-05-14
@SLIDERWEB

View doesn't help?
You make several zones, provided you give the desired zone. The condition can be placed in a separate file or be the result of the script.
Fencing logic is cool, but not always justified.
I so on channels route traffic. If the user belongs to such and such a subnet - we give this config, to another - the next config, if it does not belong to any of these subnets - we give the default config to the third channel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question