Return the DNS information of the host.
    This grain is a dictionary having two keys:

    - ``A``
    - ``AAAA``

    .. note::
        This grain is disabled by default, as the proxy startup may be slower
        when the lookup fails.
        The user can enable it using the ``napalm_host_dns_grain`` option (in
        the pillar or proxy configuration file):

        .. code-block:: yaml

            napalm_host_dns_grain: true

    .. versionadded:: 2017.7.0

    CLI Example:

    .. code-block:: bash

        salt 'device*' grains.get host_dns

    Output:

    .. code-block:: yaml

        device1:
            A:
                - 172.31.9.153
            AAAA:
                - fd52:188c:c068::1
        device2:
            A:
                - 172.31.46.249
            AAAA:
                - fdca:3b17:31ab::17
        device3:
            A:
                - 172.31.8.167
            AAAA:
                - fd0f:9fd6:5fab::1

def host_dns(proxy=None):
    '''
    Return the DNS information of the host.
    This grain is a dictionary having two keys:

    - ``A``
    - ``AAAA``

    .. note::
        This grain is disabled by default, as the proxy startup may be slower
        when the lookup fails.
        The user can enable it using the ``napalm_host_dns_grain`` option (in
        the pillar or proxy configuration file):

        .. code-block:: yaml

            napalm_host_dns_grain: true

    .. versionadded:: 2017.7.0

    CLI Example:

    .. code-block:: bash

        salt 'device*' grains.get host_dns

    Output:

    .. code-block:: yaml

        device1:
            A:
                - 172.31.9.153
            AAAA:
                - fd52:188c:c068::1
        device2:
            A:
                - 172.31.46.249
            AAAA:
                - fdca:3b17:31ab::17
        device3:
            A:
                - 172.31.8.167
            AAAA:
                - fd0f:9fd6:5fab::1
    '''
    if not __opts__.get('napalm_host_dns_grain', False):
        return
    device_host = host(proxy=proxy)
    if device_host:
        device_host_value = device_host['host']
        host_dns_ret = {
            'host_dns': {
                'A': [],
                'AAAA': []
            }
        }
        dns_a = salt.utils.dns.lookup(device_host_value, 'A')
        if dns_a:
            host_dns_ret['host_dns']['A'] = dns_a
        dns_aaaa = salt.utils.dns.lookup(device_host_value, 'AAAA')
        if dns_aaaa:
            host_dns_ret['host_dns']['AAAA'] = dns_aaaa
        return host_dns_ret