[Pdns-users] define several IP Subnet for one service in GeoIP backend

Brian Candler b.candler at pobox.com
Mon Apr 23 14:12:43 UTC 2018

On 23/04/2018 10:36, Hamed Haghshenas wrote:
> I know, it’s work with your example but I have many client subnet in 
> my network about 150 subnets .
> So a little hard to write every subnet in separated line,I want to 
> find a way to combine these in one line for every service .
The configuration is YAML, so it's very easy to write a script to 
convert from some local representation (in whatever format is convenient 
for you to maintain) to the format that PDNS requires.

import yaml

s1 = yaml.load(""", tcar.geo.gadgetworld.ir
s2 = {}

for k, v in s1.items():
     for i in k.split(","):
         s2[i] = v

print(yaml.dump(s2, default_flow_style=False))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20180423/c86243a6/attachment.html>

More information about the Pdns-users mailing list