mentat.services.dnsr module

Implementation of internal DNS service library.

class mentat.services.dnsr.DnsService(timeout=1, lifetime=3)[source]

Bases: object

Implementation of internal DNS database service.

lookup(thing)[source]

Lookup given object in DNS.

lookup_hostname(hname)[source]

Lookup given hostname in DNS.

lookup_ip(ipaddr)[source]

Lookup given IP address in DNS.

setup()[source]

Setup internal DNS service resolver.

status()[source]

Display status of internal geolocation readers.

class mentat.services.dnsr.DnsServiceManager(core_config, updates=None)[source]

Bases: object

Class representing a custom DnsServiceManager capable of understanding and parsing Mentat system core configurations and enabling easy way of unified bootstrapping of mentat.services.dns.DnsService service.

service()[source]

Return handle to DNS service according to internal configurations.

Returns

Reference to DNS service object.

Return type

mentat.services.dnsr.DnsService

mentat.services.dnsr.init(core_config, updates=None)[source]

(Re-)Initialize DnsServiceManager instance at module level and store the refence within module.

mentat.services.dnsr.manager()[source]

Obtain reference to DnsServiceManager instance stored at module level.

mentat.services.dnsr.service()[source]

Obtain reference to DnsService instance from module level manager.