Source code for dhcpkit.ipv6.server.extensions.dns.config

"""
Configuration elements for the dns option handlers
"""
from dhcpkit.ipv6.server.extensions.dns import DomainSearchListOptionHandler, RecursiveNameServersOptionHandler
from dhcpkit.ipv6.server.handlers import HandlerFactory


[docs]class RecursiveNameServersOptionHandlerFactory(HandlerFactory): """ Create the handler for recursive name servers. """
[docs] def create(self) -> RecursiveNameServersOptionHandler: """ Create a handler of this class based on the configuration in the config section. :return: A handler object """ return RecursiveNameServersOptionHandler(dns_servers=self.addresses, always_send=self.always_send)
[docs]class DomainSearchListOptionHandlerFactory(HandlerFactory): """ Create the handler for the domain search list. """
[docs] def create(self) -> DomainSearchListOptionHandler: """ Create a handler of this class based on the configuration in the config section. :return: A handler object """ return DomainSearchListOptionHandler(search_list=self.domain_names, always_send=self.always_send)