Name Dictionary

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

A dictionary whose keys are dns.name.Name objects.

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

get_deepest_match(name)[source]

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 dns.name.Name, the name to find.

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

max_depth

the maximum depth of the keys that have ever been added

max_depth_items

the number of items of maximum depth