Name Dictionary

class dns.namedict.NameDict(*args, **kwargs)[source]

A dictionary whose keys are objects.

In addition to being like a regular Python dictionary, this dictionary can also get the deepest match for a given key.


Find the deepest match to name in the dictionary.

The deepest match is the longest name in the dictionary which is a superdomain of name. Note that superdomain includes matching name itself.

name, a, the name to find.

Returns a (key, value) where key is the deepest, and value is the value associated with key.


the maximum depth of the keys that have ever been added


the number of items of maximum depth