[dnsdist] Question about the use of the method :addMask(masks)

David opendak at shaw.ca
Thu Feb 27 19:11:48 UTC 2020


On 2020-02-27 10:47 a.m., Ambauen Daniel (ID NET) via dnsdist wrote:
> Hi,
> 
> I try to understand the NetmaskGroup feature.
> https://dnsdist.org/reference/netmaskgroup.html?highlight=mask
> 
> :addMask(mask) works fine.
> 
> internal_NMG = newNMG()
> internal_NMG:addMask(‘192.168.1.0/24’)
> internal_NMG:addMask(‘192.168.2.0/24’)
> addAction(NetmaskGroupRule(internal_NMG), NoneAction())
> 
> 
> But I have difficulties to understand the correct use of :addMask(masks)
> 
>  From the documentation:
> masks (table) – Adds the keys of the table to the NetmaskGroup.
> It should be a table whose keys are ComboAddress objects and values are integers, as returned by exceed* functions.
> 
> Unfortunately I have no idea how to understand this sentence.
> Does anyone have a working example?
> 

You'd want to feed it the same data returned by one of these functions: 
https://dnsdist.org/reference/config.html?highlight=exceedservfails#exceedServFails


or manually building a table as such (why?)

 > table = {}
 > table[newCA("127.0.0.1")] = 1
 > foo:addMasks(table)

but I think the intended use case is just to pass the exceed* output into...


> 
> Thanks in advance!
> Daniel
> 
> 
> 
> 
> _______________________________________________
> dnsdist mailing list
> dnsdist at mailman.powerdns.com
> https://mailman.powerdns.com/mailman/listinfo/dnsdist
> 



More information about the dnsdist mailing list