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.

Parameters:

name (dns.name.Name) – The name to find.

Returns:

A (key, value) tuple where key is the deepest matching dns.name.Name.

max_depth

the maximum depth of the keys that have ever been added

max_depth_items

the number of items of maximum depth